Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
i have this error clients connection
#1
i have this error in client connection in java source [Изображение: 150211569008681.png]
Ответ
#2
CM_ENTER - Packet
Ответ
#3
slawa560 Написал:CM_ENTER - Packet


what must fix in this packet CM_ENTER :

/*
* Java Server Emulator Project Blackout / PointBlank
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Authors: DarkSkeleton, sjke, Felixx
* Copyright © 2013 PBDevâ„¢
*/

package ru.pb.game.network.client.packets.client;

import ru.pb.game.Application;
import ru.pb.game.network.client.packets.ClientPacket;
import ru.pb.game.network.client.packets.server.SM_ENTER;
import ru.pb.global.enums.item.ItemType;
import ru.pb.global.models.Event;
import ru.pb.global.models.FriendUpdate;
import ru.pb.global.models.Player;
import ru.pb.global.models.PlayerItem;
import ru.pb.global.service.AccountDaoService;
import ru.pb.global.service.PlayerDaoService;
import ru.pb.global.utils.DateTimeUtil;
import ru.pb.global.utils.NetworkUtil;

/**
* �еизветный пакет
*
* @author sjke
*/
public class CM_ENTER extends ClientPacket {

private String login;

public CM_ENTER(int opcode) {
super(opcode);
}

@Override
public void readImpl() {
int length = readC(); // Длинна логина
login = readS(length).trim(); // �ккаунт
readQ(); // unk
readC(); // unk
getConnection().setLocalIP(NetworkUtil.parseIp((readB(4)))); // IP аддре�
}

@Override
public void runImpl() {
if(getConnection().getAccount() == null) {
getConnection().setAccount(AccountDaoService.getInstance().readByLogin(login));

Player player = PlayerDaoService.getInstance().read(getConnection().getAccount().getId());
if(player != null) {
getConnection().setPlayer(player);
player.setCoupon1(0);
player.setCoupon2(0);
player.setCoupon3(0);
player.setCoupon4(0);
player.setCoupon5(0);
player.setCouponExp(0);
player.setCouponGp(0);
player.getConnection().account = getConnection().getAccount();
for(PlayerItem item : player.getEqipment().getItemsByType(ItemType.COUPON)) {
int Level = item.getItem().getC_Level();
int Value = item.getItem().getC_Value();

if(Level == 1 && item.getStatus() == 2)
player.setCoupon1(player.getCoupon1() + Value);

if(Level == 3 && item.getStatus() == 2)
player.setCoupon3(player.getCoupon3() + Value);

if(Level == 4 && item.getStatus() == 2)
player.setCoupon4(player.getCoupon4() + Value);

if(Level == 5 && item.getStatus() == 2)
player.setCoupon5(player.getCoupon5() + Value);

if(Level == 2 && item.getStatus() == 2)
player.setCoupon2(player.getCoupon2() + Value);

if(Level == 6 && item.getStatus() == 2) {
if(Value == 1) { // 200
player.HelpExp200 = 1;
} else if(Value == 2) { // 50
player.HelpExp150 = 1;
} else if(Value == 3) { // 30
player.HelpExp130 = 1;
}
}
if(Level == 7 && item.getStatus() == 2) {
if(Value == 1) { // 200
player.HelpGp200 = 1;
} else if(Value == 2) { // 50
player.HelpGp150 = 1;
} else if(Value == 3) { // 30
player.HelpGp130 = 1;
}
}
}
}
}
if(getConnection().getPlayer().TotalPlayMinutes == -1) {
getConnection().getPlayer().TotalPlayMinutes = -2;
for(Event c : Application.play60Min) {
if(c.startTime < DateTimeUtil.getDateTime() && c.finishTime > DateTimeUtil.getDateTime()) {
getConnection().getPlayer().TotalPlayMinutes = c.time;
}
}
}
sendPacket(new SM_ENTER());
FriendUpdate.sendFriendUpdate(getConnection());
}
}
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  UDP3 POSITION ERROR Comandante9901 13 5,331 10-10-2018, 09:20 AM
Последний пост: ChunkyHunt
  need to fix connection TomCodder 3 2,636 06-01-2018, 10:37 PM
Последний пост: TomCodder
  help me please UDP3 Event Position Error bmzproject 14 3,949 05-24-2018, 05:31 AM
Последний пост: PISTOLA
  Please someone help me kill xigncode connection Exile03 4 2,133 05-06-2018, 09:18 PM
Последний пост: Yusqa
  Help me please UDP3 error bc.log P2P_SUB_HEAD_USER bmzproject 0 1,373 03-25-2018, 06:04 PM
Последний пост: bmzproject
  help udp 3 error barte 1 1,562 02-03-2018, 06:35 PM
Последний пост: blowstom
  [Error PXSD] В чем проблема? немогу понять. Codex1to 0 1,814 12-17-2017, 07:49 PM
Последний пост: Codex1to
  Shop Tag error Yusqa 2 1,503 11-24-2017, 05:22 PM
Последний пост: Yusqa
  error in java TomCodder 6 2,332 07-06-2017, 09:07 AM
Последний пост: TomCodder
  [HELP ME] Error ID yGGhz 0 935 12-23-2016, 07:37 AM
Последний пост: yGGhz

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)