public void RecvData(int opcode, ReadPacket r) { switch (opcode) { case 300: { int status = r.readShort(); if (status > 0) { for (int i = 0; i < status; i++) { int uid = r.readInt(); string name = r.readString(); string introduce = r.readString(); int nickexist = r.readShort(); if (nickexist > 0) { string temp = r.readString(); if (temp != "") { name = temp; } } model.InsertFriend(0, new ProfileForm() { Uid = uid, NickName = name, Introduce = introduce, }); } } break; } } }
public void RecvData(int opcode, ReadPacket r) { int status = r.readShort(); switch (status) { case -1: { MessageBox.Show("서버 연결이 실패하였습니다."); break; } case 1: { MessageBox.Show("존재하지 않는 전화번호입니다."); break; } case 2: { MessageBox.Show("비밀번호가 틀렸습니다."); break; } case 5: { int uid = r.readInt(); string nickname = r.readString(); string introduce = r.readString(); FriendWindowEntity.GetInstance().Uid = uid; FriendWindowEntity.GetInstance().NickName = nickname; FriendWindowEntity.GetInstance().Introduce = introduce; Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { MainWindow main = new MainWindow(); this.Hide(); main.Show(); })); break; } } }