本文整理汇总了C#中Server.Network.Client.CloseConnection方法的典型用法代码示例。如果您正苦于以下问题:C# Client.CloseConnection方法的具体用法?C# Client.CloseConnection怎么用?C# Client.CloseConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Network.Client
的用法示例。
在下文中一共展示了Client.CloseConnection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StoryScript
//.........这里部分代码省略.........
//map.SpawnNpc(13);
//map.SpawnNpc(14);
}
break;
case 18: {//honchkrow defeated, warp opens.
IMap map = client.Player.Map;
map.SetTile(10, 6, 96, 4, 3);
map.SetTile(10, 5, 112576, 9, 3);
map.SetTile(10, 4, 112128, 9, 3);
// Left old code in case I did the math wrong...
//map.SetTile(10, 5, 128, 8032, 9, 3);
//map.SetTile(10, 4, 128, 8000, 9, 3);
map.SetAttribute(10, 6, Enums.TileType.Scripted, 46, 0, 0, "16", "683", "9:16");
Messenger.SendTile(10, 4, map);
Messenger.SendTile(10, 5, map);
Messenger.SendTile(10, 6, map);
}
break;
case 19: {//daniel's fireplace question
if (client.Player.GetActiveRecruit().HasMove(452)) {
Messenger.AskQuestion(client, "Fireplace", "Will you use Rock Smash on the fireplace?", -1);
}
}
break;
case 20: {//go into abandoned mansion
Messenger.AskQuestion(client, "AbandonedMansion2", "Only the team leader may enter this dungeon, is that OK?", -1);
}
break;
case 21: {//vs. gengar
IMap map = client.Player.Map;
if (map.MapType != Enums.MapType.Instanced) {
client.CloseConnection();
return;
}
map.SetNpcSpawnPoint(1, 11, 6);
map.SetNpcSpawnPoint(2, 12, 8);
map.SetNpcSpawnPoint(3, 14, 8);
map.SetNpc(1, 804);
map.SetNpc(2, 809);
map.SetNpc(3, 812);
//map.SpawnNpc(1);
//map.SpawnNpc(2);
//map.SpawnNpc(3);
}
break;
case 22: {//vs. Rotom
IMap map = client.Player.Map;
if (map.Name == "West Wing End") {
InstancedMap mapa = new InstancedMap(MapManager.GenerateMapID("i"));
MapCloner.CloneMapTiles(MapManager.RetrieveMap(825), mapa);
Messenger.PlayerWarp(client, mapa, 9, 10);
mapa.SetNpcSpawnPoint(1, 9, 3);
mapa.SetNpc(1, 806);
//mapa.SpawnNpc(1);
} else if (map.Name == "East Wing End") {
InstancedMap mapa = new InstancedMap(MapManager.GenerateMapID("i"));
MapCloner.CloneMapTiles(MapManager.RetrieveMap(826), mapa);
Messenger.PlayerWarp(client, mapa, 10, 10);
mapa.SetNpcSpawnPoint(1, 10, 3);
mapa.SetNpc(1, 807);
示例2: ProcessData
//.........这里部分代码省略.........
Messenger.PlainMsg(client, "Invalid password.", Enums.PlainMsgType.MainMenu);
}
}
}
else
{
Messenger.PlainMsg(client, "You are already in the Pokémon world!", Enums.PlainMsgType.MainMenu);
}
}
break;
case "charlistrequest":
{
using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players))
{
Messenger.SendChars(dbConnection, client);
}
}
break;
case "usechar":
{
int charNum = parse[1].ToInt();
if (charNum < 1 || charNum > 3)
return;
using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players))
{
if (client.Player.CharacterExists(dbConnection, charNum))
{
client.Player.LoadCharacter(dbConnection, parse[1].ToInt(1));
if (Globals.GMOnly)
{
if (client.Player.Access == Enums.Rank.Normal)
{
Messenger.PlainMsg(client, "The server is only open to GMs at the moment!", Enums.PlainMsgType.MainMenu);
client.CloseConnection();
//PlayerManager.Players.RemovePlayer(client);
//PlayerManager.Players.AddPlayer(client);
return;
}
}
if (ClientManager.IsCharacterLoggedIn(client.Player.CharID))
{
Messenger.PlainMsg(client, "You are already playing on this computer!", Enums.PlainMsgType.MainMenu);
return;
}
if (Bans.IsCharacterBanned(dbConnection, client.Player.CharID) == Enums.BanType.Ban)
{
Messenger.PlainMsg(client, "This character can't enter the Pokémon world!", Enums.PlainMsgType.MainMenu);
client.Player = new Player(client);
client.CloseConnection();
return;
}
client.Player.Statistics.HandleLogin(client.Player.GetOSVersion(), client.Player.GetDotNetVersion(), client.MacAddress, client.IP);
Messenger.SendJoinGame(client);
//Globals.ServerUI.AddLog(PlayerManager.Players.GetPlayer(client).mLogin + "/" + PlayerManager.Players.GetPlayer(client).mName + " has started playing!");
}
else
{
Messenger.PlainMsg(client, "This character hasn't been sent to the Pokémon world yet!", Enums.PlainMsgType.Chars);
return;
}
}
示例3: AlertMsg
public static void AlertMsg(Client client, string msg)
{
SendDataTo(client, TcpPacket.CreatePacket("alertmsg", msg));
client.CloseConnection();
}