本文整理汇总了C#中Game.Base.Packets.GSPacketIn类的典型用法代码示例。如果您正苦于以下问题:C# GSPacketIn类的具体用法?C# GSPacketIn怎么用?C# GSPacketIn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GSPacketIn类属于Game.Base.Packets命名空间,在下文中一共展示了GSPacketIn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
int index = packet.ReadInt();
client.Player.FightBag.RemoveItemAt(index);
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:PropDeleteHandler.cs
示例2: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.PlayerCharacter.ConsortiaID == 0)
return 0;
int id = packet.ReadInt();
bool result = false;
string msg = "ConsortiaApplyLoginPassHandler.Failed";
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
int consortiaRepute = 0;
ConsortiaUserInfo info = new ConsortiaUserInfo();
if (db.PassConsortiaApplyUsers(id, client.Player.PlayerCharacter.ID, client.Player.PlayerCharacter.NickName, client.Player.PlayerCharacter.ConsortiaID, ref msg, info, ref consortiaRepute))
{
msg = "ConsortiaApplyLoginPassHandler.Success";
result = true;
if (info.UserID != 0)
{
info.ConsortiaID = client.Player.PlayerCharacter.ConsortiaID;
info.ConsortiaName = client.Player.PlayerCharacter.ConsortiaName;
GameServer.Instance.LoginServer.SendConsortiaUserPass(client.Player.PlayerCharacter.ID, client.Player.PlayerCharacter.NickName, info, false, consortiaRepute, info.LoginName, client.Player.PlayerCharacter.FightPower);
}
}
}
packet.WriteBoolean(result);
packet.WriteString(LanguageMgr.GetTranslation(msg));
client.Out.SendTCP(packet);
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:31,代码来源:ConsortiaApplyLoginPassHandler.cs
示例3: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if(game is PVEGame)
{
PVEGame pve = game as PVEGame;
int tryAgain = packet.ReadInt();
bool isHost = packet.ReadBoolean();
if (isHost == true)
{
if (tryAgain == 1)
{
if (player.PlayerDetail.RemoveMoney(100) > 0)
{
//退回关卡结算
pve.WantTryAgain = 1;
game.SendToAll(packet);
player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_TryAgain, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
}
else
{
player.PlayerDetail.SendInsufficientMoney((int)eBattleRemoveMoneyType.TryAgain);
}
}
else
{
//退回房间
pve.WantTryAgain = 0;
game.SendToAll(packet);
}
pve.CheckState(0);
}
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:33,代码来源:TryAgainCommand.cs
示例4: OnRecvPacket
public override void OnRecvPacket(GSPacketIn pkg)
{
switch (pkg.Code)
{
case (int)eFightPackageType.LOGIN:
HandleLogin(pkg);
break;
case (int)eFightPackageType.ROOM_CREATE:
HandleGameRoomCreate(pkg);
break;
case (int)eFightPackageType.ROOM_REMOVE:
HandleGameRoomCancel(pkg);
break;
case (int)eFightPackageType.SEND_TO_GAME:
HanleSendToGame(pkg);
break;
case (int)eFightPackageType.PLAYER_USE_PROP_INGAME:
HandlePlayerUsingProp(pkg);
break;
case (int)eFightPackageType.DISCONNECT:
HandlePlayerExit(pkg);
break;
case (int)eFightPackageType.CHAT:
HandlePlayerMessage(pkg);
break;
case (int)eFightPackageType.SYS_NOTICE:
HandleSysNotice(pkg);
break;
case (int)eFightPackageType.FIND_CONSORTIA_ALLY:
HandleConsortiaAlly(pkg);
break;
default:
break;
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:ServerClient.cs
示例5: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
int activeID = packet.ReadInt();
string awardID = packet.ReadString();
string msg = "ActivePullDownHandler.Fail";
using (ActiveBussiness db = new ActiveBussiness())
{
int result = db.PullDown(activeID, awardID, client.Player.PlayerCharacter.ID,ref msg);
if (result == 0)
{
client.Out.SendMailResponse(client.Player.PlayerCharacter.ID,eMailRespose.Receiver);
}
if (msg != "ActiveBussiness.Msg0")
{
client.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation(msg));
}
else
{
client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation(msg));
}
}
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:25,代码来源:ActivePullDownHandler.cs
示例6: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.PlayerCharacter.ConsortiaID == 0)
return 0;
//Type 1表示商城,2表示铁匠铺
bool result = false;
string msg = "ConsortiaEquipControlHandler.Fail";
ConsortiaEquipControlInfo info = new ConsortiaEquipControlInfo();
info.ConsortiaID = client.Player.PlayerCharacter.ConsortiaID;
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
for (int i = 0; i < 5; i++)
{
info.Riches = packet.ReadInt();
info.Type = 1;
info.Level = i + 1;
db.AddAndUpdateConsortiaEuqipControl(info, client.Player.PlayerCharacter.ID, ref msg);
}
info.Riches = packet.ReadInt();
info.Type = 2;
info.Level = 0;
db.AddAndUpdateConsortiaEuqipControl(info, client.Player.PlayerCharacter.ID, ref msg);
msg = "ConsortiaEquipControlHandler.Success";
result = true;
}
packet.WriteBoolean(result);
packet.WriteString(LanguageMgr.GetTranslation(msg));
client.Out.SendTCP(packet);
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:ConsortiaEquipControlHandler.cs
示例7: SendLoginFailed
public void SendLoginFailed(string msg)
{
GSPacketIn pkg = new GSPacketIn((byte)ePackageType.LOGIN);
pkg.WriteByte(1);
pkg.WriteString(msg);
SendTCP(pkg);
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:AbstractPacketLib.cs
示例8: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.PlayerCharacter.ConsortiaID == 0)
return 0;
int id = packet.ReadInt();
bool isAlly = packet.ReadBoolean();
bool result = false;
string msg = "ConsortiaApplyAllyAddHandler.Add_Failed";
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
ConsortiaApplyAllyInfo info = new ConsortiaApplyAllyInfo();
info.Consortia1ID = client.Player.PlayerCharacter.ConsortiaID;
info.Consortia2ID = id;
info.Date = DateTime.Now;
info.State = 0;// isAlly ? 1 : 0;
info.Remark = "";
info.IsExist = true;
if (db.AddConsortiaApplyAlly(info, client.Player.PlayerCharacter.ID, ref msg))
{
msg = "ConsortiaApplyAllyAddHandler.Add_Success";
result = true;
}
}
packet.WriteBoolean(result);
packet.WriteString(LanguageMgr.GetTranslation(msg));
client.Out.SendTCP(packet);
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:30,代码来源:ConsortiaApplyAllyAddHandler.cs
示例9: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
//Lay Danh Sach tat ca cac phong
GSPacketIn pkg = new GSPacketIn((byte)ePackageType.HOTSPRING_ROOM_LIST_GET);
pkg.WriteInt(10);
for (int i = 0; i < 10; i++)
{
//loc_2.roomNumber = _loc_3.readInt();
pkg.WriteInt(i);
//_loc_2.roomID = _loc_3.readInt();
pkg.WriteInt(i);
//_loc_2.roomName = _loc_3.readUTF();
pkg.WriteString("Room" + i);
//_loc_2.roomPassword = _loc_3.readUTF();
pkg.WriteString("");
//_loc_2.effectiveTime = _loc_3.readInt();
pkg.WriteInt(1);
//_loc_2.curCount = _loc_3.readInt();
pkg.WriteInt(1);
//_loc_2.playerID = _loc_3.readInt();
pkg.WriteInt(client.Player.PlayerCharacter.ID);
//_loc_2.playerName = _loc_3.readUTF();
pkg.WriteString("abc");
//_loc_2.startTime = _loc_3.readDate();
pkg.WriteDateTime(DateTime.Now.AddDays(-50));
//_loc_2.roomIntroduction = _loc_3.readUTF();
pkg.WriteString("Room Intro");
//_loc_2.roomType = _loc_3.readInt();
pkg.WriteInt(1);
//_loc_2.maxCount = _loc_3.readInt();
pkg.WriteInt(10);
}
client.SendTCP(pkg);
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:HotSpringEnterHandler.cs
示例10: HandleGameRoomCreate
public void HandleGameRoomCreate(GSPacketIn pkg)
{
int roomId = pkg.ReadInt();
int gameType = pkg.ReadInt();
int count = pkg.ReadInt();
IGamePlayer[] players = new IGamePlayer[count];
for (int i = 0; i < count; i++)
{
PlayerInfo info = new PlayerInfo();
info.ID = pkg.ReadInt();
info.Attack = pkg.ReadInt();
info.Defence = pkg.ReadInt();
info.Agility = pkg.ReadInt();
info.Luck = pkg.ReadInt();
double baseAttack = pkg.ReadDouble();
double baseDefence = pkg.ReadDouble();
double baseAgility = pkg.ReadDouble();
double baseBlood = pkg.ReadDouble();
int templateId = pkg.ReadInt();
ItemTemplateInfo itemTemplate = ItemMgr.FindItemTemplate(templateId);
ItemInfo item = new ItemInfo(itemTemplate);
players[i] = new ProxyPlayer(info, item, baseAttack, baseDefence, baseAgility, baseBlood);
}
ProxyRoomMgr.CreateRoom(players, roomId, this);
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:30,代码来源:ServerClient.cs
示例11: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
eBageType bagType = (eBageType)packet.ReadByte();
int place = packet.ReadInt();
int count = packet.ReadInt();
client.Player.BeginChanges();
PlayerInventory bag = client.Player.GetInventory(bagType);
if (bag != null && bag.GetItemAt(place) != null)
{
ItemTemplateInfo item = bag.GetItemAt(place).Template;
int price = count * item.ReclaimValue;
if (item.ReclaimType == 2)
{
client.Player.AddGiftToken(price);
//client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ItemReclaimHandler.Success1", price));
}
if (item.ReclaimType == 1)
{
client.Player.AddGold(price);
//client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ItemReclaimHandler.Success2", price));
}
bag.RemoveItemAt(place);
}
else
{
client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ItemReclaimHandler.NoSuccess"));
return 1;
}
client.Player.CommitChanges();
//LogMgr.LogMoneyAdd(LogMoneyType.Shop, LogMoneyType.Shop_Continue, client.Player.PlayerCharacter.ID, 25, client.Player.PlayerCharacter.Money, 25, 0, 0, 0, "牌子编号",));
//client.Player.SaveIntoDatabase();//保存到数据库
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:35,代码来源:ItemReclaimHandler.cs
示例12: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.CurrentMarryRoom != null && client.Player.PlayerCharacter.ID == client.Player.CurrentMarryRoom.Info.PlayerID)
{
string roomName = packet.ReadString();
bool isPwdChanged = packet.ReadBoolean();
string pwd = packet.ReadString();
string introduction = packet.ReadString();
MarryRoom room = client.Player.CurrentMarryRoom;
room.Info.RoomIntroduction = introduction;
room.Info.Name = roomName;
if (isPwdChanged)
{
room.Info.Pwd = pwd;
}
using (PlayerBussiness db = new PlayerBussiness())
{
db.UpdateMarryRoomInfo(room.Info);
}
room.SendMarryRoomInfoUpdateToScenePlayers(room);
client.Player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("MarryRoomInfoUpdateHandler.Successed"));
return 0;
}
return 1;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:MarryRoomInfoUpdateHandler.cs
示例13: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
player.Skip(packet.ReadByte());
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:SkipNextCommand.cs
示例14: HandlePacket
//0友好,1黑名单
public int HandlePacket(GameClient client, GSPacketIn packet)
{
var im_cmd = packet.ReadByte();
switch (im_cmd)
{
case (byte)IMPackageType.FRIEND_ADD:
HandleFRIEND_ADD(packet);
break;
case (byte)IMPackageType.FRIEND_REMOVE:
break;
case (byte)IMPackageType.FRIEND_UPDATE:
break;
case (byte)IMPackageType.FRIEND_STATE:
break;
case (byte)IMPackageType.ONS_EQUIP:
break;
case (byte)IMPackageType.FRIEND_RESPONSE:
break;
case (byte)IMPackageType.SAME_CITY_FRIEND:
break;
case (byte)IMPackageType.ADD_CUSTOM_FRIENDS:
break;
case (byte)IMPackageType.ONE_ON_ONE_TALK:
break;
}
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:28,代码来源:IMHandler.cs
示例15: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.PlayerCharacter.ConsortiaID == 0)
return 0;
int id = packet.ReadInt();
bool upGrade = packet.ReadBoolean();
bool result = false;
string msg = "ConsortiaUserGradeUpdateHandler.Failed";
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
string tempUserName = "";
ConsortiaDutyInfo info = new ConsortiaDutyInfo();
if (db.UpdateConsortiaUserGrade(id, client.Player.PlayerCharacter.ConsortiaID, client.Player.PlayerCharacter.ID, upGrade, ref msg, ref info, ref tempUserName))
{
msg = "ConsortiaUserGradeUpdateHandler.Success";
result = true;
GameServer.Instance.LoginServer.SendConsortiaDuty(info, upGrade ? 6 : 7, client.Player.PlayerCharacter.ConsortiaID,id, tempUserName,client.Player.PlayerCharacter.ID,client.Player.PlayerCharacter.NickName);
}
}
packet.WriteBoolean(result);
packet.WriteString(LanguageMgr.GetTranslation(msg));
client.Out.SendTCP(packet);
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:26,代码来源:ConsortiaUserGradeUpdateHandler.cs
示例16: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.PlayerCharacter.ConsortiaID == 0)
return 0;
int banUserID = packet.ReadInt();
bool isBanChat = packet.ReadBoolean();
int userID = 0;
string userName = "";
bool result = false;
string msg = "ConsortiaIsBanChatHandler.Failed";
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
if (db.UpdateConsortiaIsBanChat(banUserID, client.Player.PlayerCharacter.ConsortiaID, client.Player.PlayerCharacter.ID, isBanChat, ref userID, ref userName, ref msg))
{
msg = "ConsortiaIsBanChatHandler.Success";
result = true;
GameServer.Instance.LoginServer.SendConsortiaBanChat(userID, userName, client.Player.PlayerCharacter.ID, client.Player.PlayerCharacter.NickName,isBanChat);
}
}
packet.WriteBoolean(result);
packet.WriteString(LanguageMgr.GetTranslation(msg));
client.Out.SendTCP(packet);
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:26,代码来源:ConsortiaIsBanChatHandler.cs
示例17: HandleCommand
public bool HandleCommand(TankGameLogicProcessor process, GamePlayer player, GSPacketIn packet)
{
//if (player.CurrentGame.Data.CurrentIndex == player || player.CurrentGame.Data.Players[player].State == TankGameState.FRIST || player.CurrentGame.Data.Players[player].State == TankGameState.DEAD)
if (player.CurrentGame.Data.CurrentIndex == player || player.CurrentGame.Data.Players[player].State == TankGameState.DEAD)
{
player.CurrentGame.ReturnPacket(player, packet);
player.CurrentGame.Data.Players[player].SetXY(packet.ReadInt(), packet.ReadInt());
//player.CurrentGame.Data.Players[player].StartMoving();
//GameServer.log.Error(string.Format("StopMoving {0} {1}",player.CurrentGame.Data.Players[player].X,player.CurrentGame.Data.Players[player].Y));
//由于同步问题,暂时去掉
//if (player.CurrentGame != null)
// player.CurrentGame.Data.Players[player].StartMoving();
// GameServer.log.Error(string.Format("StopMoving {0} {1}", player.CurrentGame.Data.Players[player].X, player.CurrentGame.Data.Players[player].Y));
return true;
}
else
{
//if (player.CurrentGame.Data.CurrentFire != null)
//{
//int x = packet.ReadInt();
//player.CurrentGame.Data.Players[player].PosY = packet.ReadInt();
//}
//return true;
}
return false;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:MoveStopCommand.cs
示例18: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
GSPacketIn pkg = packet.Clone();
//pkg.ClearContext();
if (client.Player.PlayerCharacter.HasBagPassword && client.Player.PlayerCharacter.IsLocked)
{
client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("Bag.Locked"));
return 0;
}
int id = packet.ReadInt();
int senderID;
using (PlayerBussiness db = new PlayerBussiness())
{
if (db.DeleteMail(client.Player.PlayerCharacter.ID, id, out senderID))
{
client.Out.SendMailResponse(senderID,eMailRespose.Receiver);
pkg.WriteBoolean(true);
}
else
{
pkg.WriteBoolean(false);
}
}
client.Out.SendTCP(pkg);
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:30,代码来源:UserDeleteMailHandler.cs
示例19: HandlePacket
//0友好,1黑名单
public int HandlePacket(GameClient client, GSPacketIn packet)
{
var pet_cmd = packet.ReadByte();
switch (pet_cmd)
{
case (byte)Game.Logic.eTankCmdType.UPDATE_PET:
HandleUPDATE_PET(client, packet.ReadInt());
break;
case (byte)Game.Logic.eTankCmdType.ADD_PET://ADD_PET
break;
case (byte)Game.Logic.eTankCmdType.MOVE_PETBAG://MOVE_PETBAG
break;
case (byte)Game.Logic.eTankCmdType.FEED_PET://FEED_PET
break;
case (byte)Game.Logic.eTankCmdType.REFRESH_PET://REFRESH_PET
client.Out.SendRefreshPet();
break;
case (byte)Game.Logic.eTankCmdType.ADOPT_PET://ADOPT_PET
break;
case (byte)Game.Logic.eTankCmdType.EQUIP_PET_SKILL://EQUIP_PET_SKILL
break;
case (byte)Game.Logic.eTankCmdType.RELEASE_PET://RELEASE_PET
break;
case (byte)Game.Logic.eTankCmdType.RENAME_PET://RENAME_PET
break;
case (byte)Game.Logic.eTankCmdType.PAY_SKILL://PAY_SKILL
break;
case (byte)Game.Logic.eTankCmdType.FIGHT_PET://FIGHT_PET
break;
}
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:33,代码来源:PetHandler.cs
示例20: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
//修改: Xiaov
//时间: 2009-11-4
//描述: 场景准备<已通过>
if (client.Player.CurrentRoom != null)
{
GSPacketIn pkgMsg = null;
List<GamePlayer> players = client.Player.CurrentRoom.GetPlayers();
foreach (GamePlayer p in players)
{
if (p != client.Player)
{
if (pkgMsg == null)
{
pkgMsg = p.Out.SendSceneAddPlayer(client.Player);
}
else
{
p.Out.SendTCP(pkgMsg);
}
client.Out.SendSceneRemovePlayer(p);
}
}
}
return 1;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:28,代码来源:UserSceneReadyHandler.cs
注:本文中的Game.Base.Packets.GSPacketIn类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论