本文整理汇总了C#中NetState.Send方法的典型用法代码示例。如果您正苦于以下问题:C# NetState.Send方法的具体用法?C# NetState.Send怎么用?C# NetState.Send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetState
的用法示例。
在下文中一共展示了NetState.Send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WorldServerUserDied
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
public static void WorldServerUserDied( NetState netState, PacketReader packetReader )
{
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData.m_bIsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 7/*6 + 1 + ?*/ )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - packetReader.Size < 7 error!" );
return;
}
byte iRespawn = packetReader.ReadByte();
//1 - Current / 2 - save point
netState.Send( new UserDiedAck( l_ExtendData.ROSEMobile ) );
}
示例2: WorldServerStopChar
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
public static void WorldServerStopChar( NetState netState, PacketReader packetReader )
{
LOGs.WriteLine( LogMessageType.MSG_NONE, " WorldServerStopChar(...)" );
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerStopChar(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerStopChar(...) - l_ExtendData.m_bIsLoggedIn == true error!" );
return;
}
if ( packetReader.Size < 16/*( 6 + 4 + 4 + 2)*/ )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerStopChar(...) - packetReader.Size < 16 error!" );
return;
}
l_ExtendData.ROSEMobile.X = (long)packetReader.ReadFloat() / 100;
l_ExtendData.ROSEMobile.Y = (long)packetReader.ReadFloat() / 100;
ushort Z = packetReader.ReadUInt16();
netState.Send( new StopCharAck( l_ExtendData.ROSEMobile ) );
Debug.WriteLine( string.Format( "WorldServerStopChar {0}, {1}, {2}", l_ExtendData.ROSEMobile.targetid, l_ExtendData.ROSEMobile.X, l_ExtendData.ROSEMobile.Y ) );
IPooledEnumerable pooledEnumerable = netState.Mobile.Map.GetClientsInRange( netState.Mobile.Location );
if ( pooledEnumerable == null )
return;
foreach ( object client in pooledEnumerable )
{
NetState l_NetState = client as NetState;
if ( l_NetState == null )
break;
l_NetState.Send( new StopCharAck( l_ExtendData.ROSEMobile ) );
}
}
示例3: WorldServerNormalChat
public static void WorldServerNormalChat( NetState netState, PacketReader packetReader )
{
LOGs.WriteLine( LogMessageType.MSG_NONE, " WorldServerNormalChat(...)" );
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerNormalChat(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerNormalChat(...) - l_ExtendData.m_bIsLoggedIn == true error!" );
return;
}
if ( packetReader.Size < 7/*( 6 + ?)*/ )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerStopChar(...) - packetReader.Size < 7 error!" );
return;
}
string l_strNormalChat = packetReader.ReadStringSafe();
LOGs.WriteLine( LogMessageType.MSG_NONE, l_strNormalChat );
BaseGameCommand l_GameCommand = GameCommands.GetGameCommand( l_strNormalChat );
if ( l_GameCommand != null )
l_GameCommand.OnEventGameCommand( netState );
else
{
netState.Send( new NormalChatAck( l_ExtendData.ROSEMobile, l_strNormalChat ) );
}
}
示例4: LoadEndAck
/// Notification that the client ressource loading has completed
/// 007D 2: No data given
public static void LoadEndAck(NetState state, PacketReader reader) {
if (state.IsValid(EAccountState.World) == false) {
state.Disconnect();
return;
}
state.Send(new WorldMessageOverHead("Welcome to Rovolution v0.1 Alpha!"));
state.Send(new WorldMessageOverHead("© GodLesZ 2011"));
// TODO: eAthena requests the registery and then trigger clif_parse_LoadEndAckk
// so move the code to a callback (if implemented an async registry loading)
// pc_reg_received
// TODO: party_member_joined, guild_member_joined
// TODO request pet and homunculus data..
state.ActiveChar.BaseStatus.CalculateCharacter(true);
// TODO: request mail box, quest log
// TODO: pc_inventory_rentals()
// clif_parse_LoadEndAck()
// Note: This is called as a packet from the client
// but if the registry loading hasent been finished, its stoped and called manually
// from pc_reg_received
// TODO: ChangeLook
// Update clothes color, or some sprite bugs & display errors will happen
if (state.ActiveChar.ViewData.ClothesColor > 0) {
state.Send(new WorldRefreshLook((int)state.Account.ID, ELookType.Clothes_color, (short)state.ActiveChar.ViewData.ClothesColor));
}
// Send inventory
// Note: This is a special packet..
// In OnBeforeSend() is checked if items are found; only if found, the packet will be send
// In OnSend() is checked for arrow and stackable items and send, if found
// So this call may send 3 packet a time, to each player
World.Send(new WorldInventoryList(state.ActiveChar), state.ActiveChar, ESendTarget.Self);
// Client got the item infos, now validate inventory
// TODO: :D
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Weight));
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Maxweight));
// TODO:shit
// - check if variable loading and every other shit has been finished
// - check for rewarp (find out)
// - changelook calls
// - send inventory list
// - check items
// - if cart on, send cart-info and check items
// - send weights
// - if guild, send short guild info
// - check for invicible timer
// - clif_spawn() (.. what? Oo)
// - if party, send infos
// - check for pvp, gvg, duel, ...
// - getareacharinfo for nearby objects
// - pet, homunculus, mercanery
// - if first connection, send complete status
// - send friendlist info (friend logged in)
// - login npc events
// - if not first connect, refresh some infos
// - many many more..
// Inform nearby objects about me
WorldObjectSpawn.Send(state.ActiveChar, true);
// Info about nearby objects
//map_foreachinarea(clif_getareachar, sd->bl.m, sd->bl.x - AREA_SIZE, sd->bl.y - AREA_SIZE, sd->bl.x + AREA_SIZE, sd->bl.y + AREA_SIZE, BL_ALL, sd);
state.ActiveChar.Map.ForeachInRange(new Rectangle2D(state.ActiveChar.Location.Point - Global.AREA_SIZE_POINT, state.ActiveChar.Location.Point - Global.AREA_SIZE_POINT), EDatabaseType.All, new ForeachInRangeVoidDelegate(Callback_GetAreaChar), new object[] { state.ActiveChar });
// TODO: spawn pets, homu, ect
if (state.ActiveChar.State.ConnectNew == true) {
state.ActiveChar.State.ConnectNew = false;
// send skills, hotkeys, status, ..
state.Send(new WorldSendSkillList(state.ActiveChar));
state.Send(new WorldSendHotkeys(state.ActiveChar));
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Baseexp));
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Nextbaseexp));
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Jobexp));
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Nextjobexp));
state.Send(new WorldUpdateStatus(state.ActiveChar, EStatusParam.Skillpoint));
state.Send(new WorldSendInitialStatus(state.ActiveChar));
if ((state.ActiveChar.StatusChange.Option & EStatusOption.Falcon) > 0) {
//.........这里部分代码省略.........
示例5: WorldServerDoID
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
internal static void WorldServerDoID( NetState netState, PacketReader packetReader )
{
LOGs.WriteLine( LogMessageType.MSG_NONE, " WorldServerDoID(...)" );
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerDoIdentify(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerDoIdentify(...) - l_ExtendData.m_bIsLoggedIn == true error!" );
return;
}
l_ExtendData.ROSEMobile.m_iClientID = RoseSerial.GetNewClientID();
if ( l_ExtendData.ROSEMobile.m_iClientID == 0 )
{
Debug.WriteLine( "WorldPacketHandlers.WorldServerDoIdentify(...) - l_ExtendData.ROSEMobile.m_iClientID == 0 error!" );
return;
}
l_ExtendData.ROSEMobile.InGame = true;
netState.Send( new Unknown0x07D5Ack( l_ExtendData.ROSEMobile ) );
netState.Send( new Unknown0x0721Ack() );
netState.Send( new Unknown0x0730Ack() );
netState.Send( new Unknown0x0753Ack( l_ExtendData.ROSEMobile ) );
netState.Send( new Unknown0x0762Ack( l_ExtendData.ROSEMobile ) );
netState.Send( new Unknown0x0782Ack( l_ExtendData.ROSEMobile ) );
netState.Send( new Unknown0x0702Ack( Program.ConfigInfo.WelcomeMessage ) );
l_ExtendData.CleanPlayerVector();
l_ExtendData.RestartPlayerVal();
}
示例6: WorldServerChangeStance
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
public static void WorldServerChangeStance( NetState netState, PacketReader packetReader )
{
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData.m_bIsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 7/*6 + 1 + ?*/ )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - packetReader.Size < 7 error!" );
return;
}
byte iStanceNum = packetReader.ReadByte();
if ( iStanceNum == 0 )
{
}
else if ( iStanceNum == 1 )
{
}
else if ( iStanceNum == 2 )
{
}
else
{
}
netState.Send( new ChangeStanceAck( l_ExtendData.ROSEMobile ) );
}
示例7: WorldServerShout
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
public static void WorldServerShout( NetState netState, PacketReader packetReader )
{
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData.m_bIsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 7/*6 + 1 + ?*/ )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - packetReader.Size < 7 error!" );
return;
}
string msg = packetReader.ReadStringSafe();
//SendToMap( &pak, thisclient->PlayerPosition->Map );
netState.Send( new ShoutAck( l_ExtendData.ROSEMobile, msg ) );
}
示例8: LoginServerGetServerIP
//.........这里部分代码省略.........
if ( l_ExtendData.IsLoggedIn == false )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerIP(...) - l_ExtendData.IsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 11 /*6 + 5*/)
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerIP(...) - packetReader.Size < 11 error!" );
return;
}
int l_iServerGuid = packetReader.ReadInt32();
int l_iChannelGuid = packetReader.ReadByte();
bool l_bIsReturn = false;
ServerInfo l_ServerInfo = null;
Session l_Session = new Session( BaseDatabase.Domain );
l_Session.BeginTransaction();
{
do
{
Query l_QueryAccounts = new Query( l_Session, "Select Accounts instances where {AccountsGuid}[email protected]" );
l_QueryAccounts.Parameters.Add( "@AccountGuid", l_ExtendData.AccountsGuid );
QueryResult l_AccountsResult = l_QueryAccounts.Execute();
if ( l_AccountsResult == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerIP(...) - l_AccountsResult == null error!" );
l_bIsReturn = true;
break;
}
if ( l_AccountsResult.Count != 1 )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerIPList(...) - l_AccountsResult.Count != 1 error!" );
l_bIsReturn = true;
break;
}
Accounts l_Accounts = l_AccountsResult[0] as Accounts;
if ( l_Accounts == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - l_Accounts == null error!" );
l_bIsReturn = true;
break;
}
l_Accounts.LastLoginDate = DateTime.Now;
l_Accounts.LastServerGuid = l_iChannelGuid;
l_Accounts.LastIP = netState.NetAddress.ToString();
//////////////////////////////////////////////////////////////////////////
Query l_QueryChannels = new Query( l_Session, "Select Channels instances where {ServerGuid}[email protected]" );
l_QueryChannels.Parameters.Add( "@ServerGuid", l_iServerGuid );
QueryResult l_ChannelsResult = l_QueryChannels.Execute();
if ( l_ChannelsResult == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerIP(...) - l_ChannelsResult == null error!" );
l_bIsReturn = true;
break;
}
if ( l_ChannelsResult.Count != 1 )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerIPList(...) - l_ChannelsResult.Count != 1 error!" );
l_bIsReturn = true;
break;
}
Channels l_Channels = l_ChannelsResult[0] as Channels;
if ( l_Channels == null )
{
Debug.WriteLine( "PacketHandlers.LoginServerGetServerNameList(...) - l_Channels == null error!" );
l_bIsReturn = true;
break;
}
l_ServerInfo = new ServerInfo( l_Channels.ServerName, l_Channels.ServerGuid, l_Channels.Status, TimeZone.CurrentTimeZone, new IPEndPoint( IPAddress.Parse( l_Channels.Host ), l_Channels.Port ) );
} while ( false );
}
l_Session.Commit();
if ( l_bIsReturn == true )
return;
if ( l_ServerInfo != null )
netState.Send( new GetServerIPAck( l_ServerInfo, (int)l_ExtendData.AccountsGuid ) );
}
示例9: LoginServerEncryptionRequest
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
internal static void LoginServerEncryptionRequest( NetState netState, PacketReader packetReader )
{
LOGs.WriteLine( LogMessageType.MSG_NOTICE, "LoginPacketHandlers.LoginServerEncryptionRequest(...){0}", Thread.CurrentThread.Name );
netState.Send( new EncryptionRequestAck() );
}
示例10: AccountLogin_ReplyRej
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="alrReason"></param>
internal static void AccountLogin_ReplyRej( NetState netState, LoginReason alrReason )
{
netState.Send( new AccountLoginRej( alrReason ) );
}
示例11: LoginServerGetServerNameList
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
internal static void LoginServerGetServerNameList( NetState netState, PacketReader packetReader )
{
LOGs.WriteLine( LogMessageType.MSG_NOTICE, "LoginPacketHandlers.LoginServerGetServerNameList(...){0}", Thread.CurrentThread.Name );
LoginServerExtendData l_ExtendData = netState.ExtendData as LoginServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.IsLoggedIn == false )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - l_ExtendData.IsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 10/*6 + 4*/ )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - packetReader.Size < 10 error!" );
return;
}
int l_iChannelGuid = packetReader.ReadInt32();
bool l_bIsReturn = false;
ServerInfo[] l_ServerInfoArray = new ServerInfo[0];
Session l_Session = new Session( BaseDatabase.Domain );
l_Session.BeginTransaction();
{
do
{
Query l_QueryChannels = new Query( l_Session, "Select Channels instances where {OwnerGuid}[email protected]" );
l_QueryChannels.Parameters.Add( "@ChannelGuid", l_iChannelGuid );
QueryResult l_ChannelsResult = l_QueryChannels.Execute();
if ( l_ChannelsResult == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - l_ChannelsResult == null error!" );
l_bIsReturn = true;
break;
}
if ( l_ChannelsResult.Count <= 0 )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - l_ChannelsResult.Count <= 0 error!" );
l_bIsReturn = true;
break;
}
l_ServerInfoArray = new ServerInfo[l_ChannelsResult.Count];
for ( int iIndex = 0; iIndex < l_ChannelsResult.Count; iIndex++ )
{
Channels l_Channels = l_ChannelsResult[iIndex] as Channels;
if ( l_Channels == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.LoginServerGetServerNameList(...) - l_Channels == null error!" );
l_bIsReturn = true;
break;
}
long iFullPercent = ( ( ( 100 * l_Channels.Connected ) / l_Channels.MaxConnected == 0 ? 1 : l_Channels.MaxConnected ) / 5 ) & 0xFF;
l_ServerInfoArray[iIndex] = new ServerInfo( l_Channels.ServerName, l_Channels.ServerGuid, iFullPercent, TimeZone.CurrentTimeZone, new IPEndPoint( IPAddress.Parse( l_Channels.Host ), l_Channels.Port ) );
}
} while ( false );
}
l_Session.Commit();
if ( l_bIsReturn == true )
return;
netState.Send( new GetServerNameListAck( l_ServerInfoArray, l_iChannelGuid ) );
}
示例12: AccountLogin_ReplyAck
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
internal static void AccountLogin_ReplyAck( NetState netState )
{
bool l_bIsReturn = false;
ServerInfo[] l_ServerInfoArray = s_ServerInfoArray;
Session l_Session = new Session( BaseDatabase.Domain );
l_Session.BeginTransaction();
{
do
{
Query l_QueryChannels = new Query( l_Session, "Select Channels instances where {OwnerGuid}=0" );
QueryResult l_ChannelsResult = l_QueryChannels.Execute();
if ( l_ChannelsResult == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.AccountLogin_ReplyAck(...) - l_ChannelsResult == null error!" );
AccountLogin_ReplyRej( netState, LoginReason.LoginFailed );
l_bIsReturn = true;
break;
}
if ( l_ChannelsResult.Count <= 0 )
{
Debug.WriteLine( "LoginServerPacketHandlers.AccountLogin_ReplyAck(...) - l_ChannelsResult.Count <= 0 error!" );
AccountLogin_ReplyRej( netState, LoginReason.LoginFailed );
l_bIsReturn = true;
break;
}
l_ServerInfoArray = new ServerInfo[l_ChannelsResult.Count];
for ( int iIndex = 0; iIndex < l_ServerInfoArray.Length; iIndex++ )
{
Channels l_Channels = l_ChannelsResult[iIndex] as Channels;
if ( l_Channels == null )
{
Debug.WriteLine( "LoginServerPacketHandlers.AccountLogin_ReplyAck(...) - l_Channels == null error!" );
AccountLogin_ReplyRej( netState, LoginReason.LoginFailed );
l_bIsReturn = true;
break;
}
l_ServerInfoArray[iIndex] = new ServerInfo( l_Channels.ServerName, l_Channels.ServerGuid, l_Channels.Status, TimeZone.CurrentTimeZone, new IPEndPoint( IPAddress.Parse( l_Channels.Host ), l_Channels.Port ) );
}
} while ( false );
}
l_Session.Commit();
if ( l_bIsReturn == true )
return;
//ServerListEventArgs l_EventArgs = new ServerListEventArgs( netState, netState.Account );
//EventSink.InvokeServerList( l_EventArgs );
//if ( l_EventArgs.Rejected == true )
//{
// netState.Account = null;
// netState.Send( new AccountLoginRej( LoginReason.LoginFailed ) );
// netState.Dispose();
//}
//else
{
//ServerInfo[] info = e.Servers.ToArray();
//netState.ServerInfo = l_ServerInfo;
netState.Send( new AccountLoginAck( l_ServerInfoArray ) );
}
}
示例13: QuitGame
/// Request for game exiting
/// 018A 4: <dont_know>.W
public static void QuitGame(NetState state, PacketReader reader) {
if (state.IsValid(EAccountState.World) == false) {
state.Disconnect();
return;
}
// TODO: logout check
// Save data
state.ActiveChar.Save();
state.Send(new WorldResponseGameExit(true));
}
示例14: CharNameRequest
/// Requesting unit's name
/// 0094 14: <dont_know>.? Position 10 <object id>.L
public static void CharNameRequest(NetState state, PacketReader reader) {
if (state.IsValid(EAccountState.World) == false) {
state.Disconnect();
return;
}
reader.Seek(10, System.IO.SeekOrigin.Begin);
int id = reader.ReadInt32();
// Disguises using -ID..
if (id < 0 && -id == state.Account.ID) {
id = (int)state.Account.ID;
}
// First option - a character
WorldObject obj = World.Objects[EDatabaseType.Char, id];
if (obj == null) {
// 2nd - a monster
obj = World.Objects[EDatabaseType.Mob, id];
if (obj == null) {
// 3rd - a item (?)
obj = World.Objects[EDatabaseType.Item, id];
if (obj == null) {
// Lagged clients could request names of already gone mobs/players..
// so no disconnect on invalid requests..
//state.Disconnect();
return;
}
}
}
// Fix: we send the accountID as unique ID for chars (its working because no account could connect twice)
// this leads to this situation, we will get the account object from World.Objects
// instead of the character
if (obj is Account) {
obj = (obj as Account).ActiveChar;
}
// Moveable unit?
if (
(obj is WorldObjectUnit) && (
(obj as WorldObjectUnit).Location.Map != state.Account.ActiveChar.Location.Map ||
(obj as WorldObjectUnit).InRange(state.ActiveChar, Global.AREA_SIZE) == false
)
) {
return; // Block namerequests past view range
}
// 'see people in GM hide' cheat detection
/* disabled due to false positives (network lag + request name of char that's about to hide = race condition)
sc = status_get_sc(bl);
if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) &&
bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple
pc_isGM(sd) < battle_config.hack_info_GM_level
) {
char gm_msg[256];
sprintf(gm_msg, "Hack on NameRequest: character '%s' (account: %d) requested the name of an invisible target (id: %d).\n", sd->status.name, sd->status.account_id, id);
ShowWarning(gm_msg);
// information is sent to all online GMs
intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, gm_msg);
return;
}
*/
state.Send(new WorldResponseCharNameAck(obj));
}
示例15: WorldServerWeight
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
public static void WorldServerWeight( NetState netState, PacketReader packetReader )
{
WorldServerExtendData l_ExtendData = netState.ExtendData as WorldServerExtendData;
if ( l_ExtendData == null )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData == null error!" );
return;
}
if ( l_ExtendData.ROSEMobile.IsLoggedIn == false )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - l_ExtendData.m_bIsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 7/*6 + 1 + ?*/ )
{
Debug.WriteLine( "CharPacketHandlers.LoginAction(...) - packetReader.Size < 7 error!" );
return;
}
byte iWeight = packetReader.ReadByte();
if ( iWeight > 110 )
{
}
else
{
}
if ( iWeight > 100 )
{
}
else
{
}
netState.Send( new WeightAck( l_ExtendData.ROSEMobile, iWeight ) );
}