//네트웍으로 받은 움직일 좌표 public void Grenade_Net_Move(ByteData _Receive_data) { _Receive_data.OutPutVariable(ref Net_Target_Pos); _Receive_data.OutPutVariable(ref Net_EulerAngles); NC_Move_Distance = 0.0f; }
//킬링 메시지 void Recv_Killing_Message(ByteData _Receive_data) { // byte : 유저수 // uint : 방 유저 WebUserID // string : KILL 문구 byte Total_User_Count = 0; uint _User_ID = 0; String _User_Killing_Message = ""; //전체 플레이어 숫자 _Receive_data.OutPutVariable(ref Total_User_Count); for (int i = 0; i < Total_User_Count; i++) { _Receive_data.OutPutVariable(ref _User_ID); _Receive_data.OutPutVariable(ref _User_Killing_Message); if (Link_Script.i.User_Data.ContainsKey(_User_ID) == false) { continue; } //Debug.Log("_User_ID = " + _User_ID + ", _User_Killing_Message = " + _User_Killing_Message); Link_Script.i.User_Data[_User_ID].Killing_Message = _User_Killing_Message; } }
//폭발 데이터 받기 public void Grenade_Explosion_Receive_Data(ByteData _Receive_data) { byte _Explosion_State = 0; _Receive_data.OutPutVariable(ref _Explosion_State); _Receive_data.OutPutVariable(ref Explosion_Pos); Explosion_State = (EXPLOSION_STATE)_Explosion_State; }
void Recv_Base_HP(ByteData _Receive_data) { // float : 최대 체력 // float : Red팀 진지 체력 // float : Blue팀 진지 체력 _Receive_data.OutPutVariable(ref Link_Script.i.Base_OJ_Max_HP); _Receive_data.OutPutVariable(ref Link_Script.i.Base_OJ_Now_HP[0]); _Receive_data.OutPutVariable(ref Link_Script.i.Base_OJ_Now_HP[1]); }
void Recieve_STC_ERROR(ByteData _recieveBuffer) { byte Error_Code = 0; RecieveBuffer.OutPutVariable(ref Error_Code); ErrorCode errorCode = (ErrorCode)Error_Code; UI_Popup_Notice popup = UI_Manager.Getsingleton.CreatAndGetPopup <UI_Popup_Notice>(UIPOPUP.POPUPNOTICE); switch (errorCode) { case ErrorCode.LOGIN_OVERLAP_MATCH: case ErrorCode.LOGIN_OVERLAP_BATTLE: case ErrorCode.LOGIN_OVERLAP_CHATTING: popup.Set_PopupTitleMessage(TextDataManager.Dic_TranslateText[145]); // 알림 popup.SetPopupMessage(TextDataManager.Dic_TranslateText[248]); // 로그인 중복!\n 게임을 종료합니다. popup.Set_addEventButton(Application.Quit); break; case ErrorCode.ROOM_IS_FULL: popup.Set_PopupTitleMessage(TextDataManager.Dic_TranslateText[145]); //알림 popup.SetPopupMessage(TextDataManager.Dic_TranslateText[507]); // 해당 방이 꽉 찼습니다. break; case ErrorCode.ROOM_IS_NULL: popup.Set_PopupTitleMessage(TextDataManager.Dic_TranslateText[145]); popup.SetPopupMessage(TextDataManager.Dic_TranslateText[508]); // 해당 방이 존재하지 않습니다." break; default: break; } }
void Recv_GetServerTime(ByteData _Receive_data) { if (Game_Script == null) { return; } // long : 서버 현재 시간 // long : 종료 예정 시간 long Server_Now_Time = 0; long Server_End_Time = 0; _Receive_data.OutPutVariable(ref Server_Now_Time); _Receive_data.OutPutVariable(ref Server_End_Time); Game_Script.Play_GameStart_Time = new DateTime(Server_Now_Time) - DateTime.Now; Game_Script.Play_GameEnd_Time = new DateTime(Server_End_Time); }
void Recv_Now_Respawn_Data(ByteData _Receive_data) { if (Game_Script == null) { return; } //int : 골드 재화 보유량 //int : 보석 재화 보유량 //byte : 즉시 부활 종류 byte _Respawn_Kind = 0; _Receive_data.OutPutVariable(ref Link_Script.i.Player_Gold); _Receive_data.OutPutVariable(ref Link_Script.i.Player_Diamond); _Receive_data.OutPutVariable(ref _Respawn_Kind); SendManager.Instance.Set_userGoods(ITEMTYPE.GOLD, Link_Script.i.Player_Gold); SendManager.Instance.Set_userGoods(ITEMTYPE.GEM, Link_Script.i.Player_Diamond); Game_Script.Respawn_Kind = (RESPAWN_KIND)_Respawn_Kind; }
//HP 데이터 갱신 void Recv_Set_HP(ByteData _Receive_data) { if (Game_Script == null) { return; } uint ATK_User_ID = 0; uint DEF_User_ID = 0; float DEF_HP = 0; Vector3 ATK_Start_Vec = new Vector3(); Vector3 ATK_Target_Vec = new Vector3(); byte Gun_Type = 0; bool Critical_Check = false; float Damage_Num = 0.0f; _Receive_data.OutPutVariable(ref ATK_User_ID); _Receive_data.OutPutVariable(ref DEF_User_ID); _Receive_data.OutPutVariable(ref DEF_HP); _Receive_data.OutPutVariable(ref ATK_Start_Vec); _Receive_data.OutPutVariable(ref ATK_Target_Vec); _Receive_data.OutPutVariable(ref Gun_Type); _Receive_data.OutPutVariable(ref Critical_Check); _Receive_data.OutPutVariable(ref Damage_Num); if (ATK_User_ID != DEF_User_ID)//자살이 아닐때 { //공격한 유저 if (Game_Script.Char_Script.ContainsKey(ATK_User_ID)) { Game_Script.Char_Script[ATK_User_ID].Receive_ATK_UI_Damage_Init(DEF_User_ID, Critical_Check, Damage_Num); } //공격 당한 유저 if (Game_Script.Char_Script.ContainsKey(DEF_User_ID)) { Game_Script.Char_Script[DEF_User_ID].Receive_ATK_Data(DEF_HP, ATK_Start_Vec, ATK_Target_Vec, Gun_Type); } } else//자살로 판단한다. { //공격 당한 유저 if (Game_Script.Char_Script.ContainsKey(DEF_User_ID)) { Game_Script.Char_Script[DEF_User_ID].Receive_ATK_Data(DEF_HP, ATK_Start_Vec, ATK_Target_Vec, (byte)GUN_TYPE.SUICIDE); } } }
void Recv_Respawn_Data(ByteData _Receive_data) { if (Game_Script == null) { return; } uint User_ID = 0; _Receive_data.OutPutVariable(ref User_ID); if (Game_Script.Char_Script.ContainsKey(User_ID)) { Game_Script.Char_Script[User_ID].Recv_Respawn_Data(_Receive_data); } }
//P to P : 데이터 받기 void Recv_PTP_Data(ByteData _Receive_data) { if (Game_Script == null) { return; } Relay_Protocol = 0; Relay_User_ID = 0; _Receive_data.OutPutVariable(ref Relay_Protocol); switch ((RELAY_PROTOCOL)Relay_Protocol) { case RELAY_PROTOCOL.MOVE: //유닛 이동 데이터 받기 Game_Script.Recv_Char_Move_Data(_Receive_data); break; case RELAY_PROTOCOL.SHOT: //유닛 총쏘는 데이터 받기 _Receive_data.OutPutVariable(ref Relay_User_ID); if (Game_Script.Char_Script.ContainsKey(Relay_User_ID) == false) { break; } Game_Script.Char_Script[Relay_User_ID].Network_Char_Shot_Pos(_Receive_data); break; case RELAY_PROTOCOL.SHOTGUN_SHOT: //유닛 샷건 총쏘는 데이터 받기 _Receive_data.OutPutVariable(ref Relay_User_ID); if (Game_Script.Char_Script.ContainsKey(Relay_User_ID) == false) { break; } Game_Script.Char_Script[Relay_User_ID].Network_Char_ShotGun_Pos(_Receive_data); break; case RELAY_PROTOCOL.GRENADE_MOVE: //수류탄 움직임 데이터 Game_Script.Recv_Grenade_Move_Data(_Receive_data); break; case RELAY_PROTOCOL.GRENADE_EXPLOSION: //수류탄 터지는 데이터 Game_Script.Recv_Explosion_Data(_Receive_data); break; case RELAY_PROTOCOL.SKILL: //유닛 스킬 데이터 받기 Game_Script.Recv_Char_Skill_Data(_Receive_data); break; case RELAY_PROTOCOL.REVENGE_OK: //복수 성공 데이터 받기 _Receive_data.OutPutVariable(ref Relay_User_ID); if (Game_Script.Char_Script.ContainsKey(Relay_User_ID) == false) { break; } Game_Script.Char_Script[Relay_User_ID].Revenge_OK_Recv_Data(); break; case RELAY_PROTOCOL.BARRIER_CHECK: //방어막 데이터 받기 _Receive_data.OutPutVariable(ref Relay_User_ID); if (Game_Script.Char_Script.ContainsKey(Relay_User_ID) == false) { break; } Game_Script.Char_Script[Relay_User_ID].Barrier_Recv_Data(_Receive_data); break; case RELAY_PROTOCOL.VOICE_CHAT: //음성챗팅 데이터 받기 Game_Script.Recv_Voice_Chat_Data(_Receive_data); break; case RELAY_PROTOCOL.OBTAINITEM_MOVE: //게임획득아이템 데이터받기 Game_Script.Recv_OtainGameItem_Move_Data(_Receive_data); break; default: Disconnect(" P to P 선언 되지 않은 프로토콜 : " + Relay_Protocol); break; } }
//1인 퀵조인 답변 void Recv_Quick_Join(ByteData _Receive_data) { // byte : 전투 종류 (BattleKind) // byte : 맵 인덱스 // byte : 게임종료 킬수 // byte : 유저수 // uint : 방 유저 WebUserID // string : 닉네임 // byte : 팀 (Red:0, Blue:1, Draw:2) // byte : 시작(부활 + 입장) 포인트 // ushort : 클랜 마크 /// byte[2] : 국가코드 byte Total_User_Count = 0; uint _User_ID = 0; String _User_NickName = ""; byte _User_Team = 0; byte _User_Start_Pos_Index = 0; ushort _User_Clan_Mark = 0; byte[] _User_Country_Mark = new byte[2]; Link_Script.i.User_Data.Clear(); //전투 종류 byte Temp_BattleKind = 0; _Receive_data.OutPutVariable(ref Temp_BattleKind); Link_Script.i.Play_Mode = (BattleKind)Temp_BattleKind; //맵 인덱스 _Receive_data.OutPutVariable(ref Link_Script.i.MapIndex); //게임 종료 목표 킬수 _Receive_data.OutPutVariable(ref Link_Script.i.GameOver_Kill_Max); //전체 플레이어 숫자 _Receive_data.OutPutVariable(ref Total_User_Count); for (int i = 0; i < Total_User_Count; i++) { _Receive_data.OutPutVariable(ref _User_ID); _Receive_data.OutPutVariable(ref _User_NickName); _Receive_data.OutPutVariable(ref _User_Team); _Receive_data.OutPutVariable(ref _User_Start_Pos_Index); _Receive_data.OutPutVariable(ref _User_Clan_Mark); _Receive_data.OutPutVariable(ref _User_Country_Mark[0]); _Receive_data.OutPutVariable(ref _User_Country_Mark[1]); if (Link_Script.i.User_Data.ContainsKey(_User_ID)) { Debug.LogError(_User_ID + " : 이 아이디가 중복되서 들어왔다"); } Link_Script.i.User_Data.Add(_User_ID, new Link_Script.User_Data_class()); Link_Script.i.User_Data[_User_ID].User_ID = _User_ID; Link_Script.i.User_Data[_User_ID].User_NickName = _User_NickName; Link_Script.i.User_Data[_User_ID].User_Team = _User_Team; Link_Script.i.User_Data[_User_ID].Start_Pos_Index = _User_Start_Pos_Index; Link_Script.i.User_Data[_User_ID].User_Clan_Mark = _User_Clan_Mark; Link_Script.i.User_Data[_User_ID].User_Country_Mark = new byte[2]; Link_Script.i.User_Data[_User_ID].User_Country_Mark[0] = _User_Country_Mark[0]; Link_Script.i.User_Data[_User_ID].User_Country_Mark[1] = _User_Country_Mark[1]; } //내 캐릭터의 정보 Link_Script.i.User_Team = Link_Script.i.User_Data[Link_Script.i.User_ID].User_Team; Link_Script.i.Start_Pos_Index = Link_Script.i.User_Data[Link_Script.i.User_ID].Start_Pos_Index; if (Network_State == NETWORK_STATE.QUICKJOINING) { Network_State = NETWORK_STATE.QUICKJOIN_OK; //퀵조인 성공시 호출 SendManager.Instance.Complete_QuickJoin(Link_Script.i.MapIndex); } }