本文整理汇总了C#中DOL.GS.GameClient.GetTranslation方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetTranslation方法的具体用法?C# GameClient.GetTranslation怎么用?C# GameClient.GetTranslation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOL.GS.GameClient
的用法示例。
在下文中一共展示了GameClient.GetTranslation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
//.........这里部分代码省略.........
(ushort)client.Player.BindRegion,
client.Player.BindXpos,
client.Player.BindYpos,
(ushort)client.Player.BindZpos,
(ushort)client.Player.BindHeading
);
return;
}
int realX = newZone.XOffset + xOffsetInZone;
int realY = newZone.YOffset + yOffsetInZone;
bool zoneChange = newZone != client.Player.LastPositionUpdateZone;
if (zoneChange)
{
//If the region changes -> make sure we don't take any falling damage
if (client.Player.LastPositionUpdateZone != null && newZone.ZoneRegion.ID != client.Player.LastPositionUpdateZone.ZoneRegion.ID)
client.Player.MaxLastZ = int.MinValue;
// Update water level and diving flag for the new zone
client.Out.SendPlayerPositionAndObjectID();
zoneChange = true;
/*
* "You have entered Burial Tomb."
* "Burial Tomb"
* "Current area is adjusted for one level 1 player."
* "Current area has a 50% instance bonus."
*/
string description = newZone.Description;
string screenDescription = description;
var translation = client.GetTranslation(newZone) as DBLanguageZone;
if (translation != null)
{
if (!Util.IsEmpty(translation.Description))
description = translation.Description;
if (!Util.IsEmpty(translation.ScreenDescription))
screenDescription = translation.ScreenDescription;
}
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "PlayerPositionUpdateHandler.Entered", description),
eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(screenDescription, eChatType.CT_ScreenCenterSmaller, eChatLoc.CL_SystemWindow);
client.Player.LastPositionUpdateZone = newZone;
}
int coordsPerSec = 0;
int jumpDetect = 0;
int timediff = Environment.TickCount - client.Player.LastPositionUpdateTick;
int distance = 0;
if (timediff > 0)
{
distance = client.Player.LastPositionUpdatePoint.GetDistanceTo(new Point3D(realX, realY, realZ));
coordsPerSec = distance * 1000 / timediff;
if (distance < 100 && client.Player.LastPositionUpdatePoint.Z > 0)
{
jumpDetect = realZ - client.Player.LastPositionUpdatePoint.Z;
}
}
示例2: GetTranslatedSpotDescription
/// <summary>
/// Get Spot Description Checking Any Area with Description or Zone Description and Try Translating it
/// </summary>
/// <param name="reg"></param>
/// <param name="client"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="z"></param>
/// <returns></returns>
public static string GetTranslatedSpotDescription(this Region reg, GameClient client, int x, int y, int z)
{
if (reg != null)
{
var area = reg.GetAreasOfSpot(x, y, z).OfType<AbstractArea>().FirstOrDefault(a => a.DisplayMessage);
// Try Translate Area First
if (area != null)
{
var lng = client.GetTranslation(area) as DBLanguageArea;
if (lng != null && !Util.IsEmpty(lng.ScreenDescription))
return lng.ScreenDescription;
return area.Description;
}
var zone = reg.GetZone(x, y);
// Try Translate Zone
if (zone != null)
{
var lng = client.GetTranslation(zone) as DBLanguageZone;
if (lng != null)
return lng.ScreenDescription;
return zone.Description;
}
return reg.Description;
}
return string.Empty;
}