本文整理汇总了C#中Game.Base.Packets.GSPacketIn.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# GSPacketIn.ReadBoolean方法的具体用法?C# GSPacketIn.ReadBoolean怎么用?C# GSPacketIn.ReadBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game.Base.Packets.GSPacketIn
的用法示例。
在下文中一共展示了GSPacketIn.ReadBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if(game is PVEGame)
{
PVEGame pve = game as PVEGame;
bool tryAgain = packet.ReadBoolean();
bool isHost = packet.ReadBoolean();
if (isHost == true)
{
if (tryAgain == true)
{
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);
}
}
}
示例2: 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;
}
示例3: HandlePacket
//修改: Xiaov
//时间: 2009-11-7
//描述: 获取用户装备<已测试>
public int HandlePacket(GameClient client, GSPacketIn packet)
{
bool type = packet.ReadBoolean();//_loc_3.writeBoolean(true);
int id = packet.ReadInt();
string nickname;
if (!type)
nickname = packet.ReadString();
GamePlayer player = Managers.WorldMgr.GetPlayerById(id);
PlayerInfo info;
List<ItemInfo> items;
if (player != null)
{
info = player.PlayerCharacter;
items = player.MainBag.GetItems(0, 31);
}
else
{
using (PlayerBussiness pb = new PlayerBussiness())
{
info = pb.GetUserSingleByUserID(id);
items = pb.GetUserEuqip(id);
}
}
if (info != null && items != null)
client.Out.SendUserEquip(info, items);
return 0;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.CurrentRoom != null && client.Player == client.Player.CurrentRoom.Host)
{
RoomMgr.UpdateRoomPos(client.Player.CurrentRoom, packet.ReadByte(), packet.ReadBoolean());
}
return 0;
}
示例8: HandleASSState
public void HandleASSState(GSPacketIn packet)
{
bool state = packet.ReadBoolean();
AntiAddictionMgr.SetASSState(state);
//GamePlayer[] players = WorldMgr.GetAllPlayers();
//foreach (GamePlayer p in players)
//{
//p.Out.SendAASControl(state, p.IsAASInfo, p.IsMinor);
//}
}
示例9: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
game.SendToAll(packet);
bool tag = packet.ReadBoolean();
byte speedTime = packet.ReadByte();
player.PrepareShoot(speedTime);
}
}
示例10: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
bool result = packet.ReadBoolean();
int UserID = packet.ReadInt();
int AnswerId = packet.ReadInt(); //答复对话框ID
//先判断自已有没有结婚
if (result && client.Player.PlayerCharacter.IsMarried)
{
client.Player.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("MarryApplyReplyHandler.Msg2"));
}
using (PlayerBussiness db = new PlayerBussiness())
{
PlayerInfo tempSpouse = db.GetUserSingleByUserID(UserID);
//发送好人卡
if (!result)
{
SendGoodManCard(tempSpouse.NickName, tempSpouse.ID, client.Player.PlayerCharacter.NickName, client.Player.PlayerCharacter.ID, db);
GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(tempSpouse.ID);
}
//判断对方有没有结婚
if (tempSpouse == null || tempSpouse.Sex == client.Player.PlayerCharacter.Sex)
{
return 1;
}
if (tempSpouse.IsMarried)
{
client.Player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("MarryApplyReplyHandler.Msg3"));
}
MarryApplyInfo info = new MarryApplyInfo();
info.UserID = UserID;
info.ApplyUserID = client.Player.PlayerCharacter.ID;
info.ApplyUserName = client.Player.PlayerCharacter.NickName;
info.ApplyType = 2;
info.LoveProclamation = "";
info.ApplyResult = result;
int id = 0;
if (db.SavePlayerMarryNotice(info, AnswerId, ref id))
{
if (result)
{
client.Player.Out.SendMarryApplyReply(client.Player, tempSpouse.ID, tempSpouse.NickName, result, false, id);
client.Player.LoadMarryProp();
SendSYSMessages(client.Player, tempSpouse);
}
GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(tempSpouse.ID);
return 0;
}
}
return 1;
}
示例11: HandlePacket
//修改: Xiaov
//时间: 2009-11-7
//描述: 用户与用户之间私聊<已测试>
public int HandlePacket(GameClient client, GSPacketIn packet)
{
int receiverID = packet.ReadInt();
//int senderID = packet.ReadInt();
string receiver = packet.ReadString();
string sender = packet.ReadString();
string msg = packet.ReadString();
bool isAutoReply = packet.ReadBoolean();
if (receiverID == 0)
{
using (PlayerBussiness db = new PlayerBussiness())
{
PlayerInfo info = db.GetUserSingleByNickName(receiver);
if (info != null)
receiverID = info.ID;
}
}
if (receiverID != 0)
{
GSPacketIn pkg = packet.Clone();
pkg.ClearContext();
pkg.WriteInt(receiverID);
pkg.ClientID = (client.Player.PlayerCharacter.ID);
//pkg.WriteInt(senderID);
pkg.WriteString(receiver);
pkg.WriteString(sender);
pkg.WriteString(msg);
pkg.WriteBoolean(false);
GamePlayer player = Managers.WorldMgr.GetPlayerById(receiverID);
if (player != null)
{
if (player.IsBlackFriend(client.Player.PlayerCharacter.ID))
return 1;
player.Out.SendTCP(pkg);
}
else
{
GameServer.Instance.LoginServer.SendPacket(pkg);
}
client.Out.SendTCP(pkg);
}
else
{
client.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("UserPrivateChatHandler.NoUser"));
}
return 1;
}
示例12: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
//_loc_3.writeBoolean(param2);
bool responseLuckyNum = packet.ReadBoolean();
//_loc_3.writeInt(param1);
int LuckyNum = packet.ReadInt();
//GSPacketIn pkg = packet.Clone();
//pkg.WriteInt(2);
//pkg.WriteString("False,False,True,True");
//client.SendTCP(pkg);
return 1;
}
示例13: HandleConfigState
public void HandleConfigState(GSPacketIn packet)
{
bool aSSState = packet.ReadBoolean();
bool dailyState = packet.ReadBoolean();
AwardMgr.DailyAwardState = dailyState;
AntiAddictionMgr.SetASSState(aSSState);
//GamePlayer[] players = WorldMgr.GetAllPlayers();
//foreach (GamePlayer p in players)
//{
//p.Out.SendAASControl(aSSState, p.IsAASInfo, p.IsMinor);
//}
}
示例14: HandlePacket
//修改: Xiaov
//时间: 2009-11-7
//描述: 隐藏装备<已测试>
public int HandlePacket(GameClient client,GSPacketIn packet)
{
bool hide = packet.ReadBoolean();
int categroyID = packet.ReadInt();
switch (categroyID)
{
case 13:
categroyID = 3;
break;
}
client.Player.HideEquip(categroyID, hide);
return 0;
}
示例15: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
packet.Parameter1 = player.Id;
game.SendToAll(packet);
//同客户端同步LifeTime
game.SendSyncLifeTime();
bool tag = packet.ReadBoolean();
//开炮所需时间
byte speedTime = packet.ReadByte();
player.PrepareShoot(speedTime);
}
}