Initial commit

This commit is contained in:
gh0stl1ne
2019-10-21 22:38:10 +02:00
committed by GitHub
commit cfee12351a
47 changed files with 7365 additions and 0 deletions

51
bioserver/Area.java Normal file
View File

@@ -0,0 +1,51 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
public class Area {
// status of the area
public static final byte STATUS_ACTIVE = 3;
public static final byte STATUS_INACTIVE = 0;
private int nr;
private String name;
private String description;
private byte status;
public Area(int number, String name, String description, byte status) {
this.nr = number;
this.name = name;
this.description = description;
this.status = status;
}
public byte getStatus() {
return status;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
}

58
bioserver/Areas.java Normal file
View File

@@ -0,0 +1,58 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.util.LinkedList;
import java.util.List;
/**
* All areas
*/
public class Areas {
private List areas;
// setup our areas
public Areas() {
areas = new LinkedList();
areas.add(new Area(1, "East Town", "<BODY><SIZE=3>standard rules<END>", Area.STATUS_ACTIVE));
areas.add(new Area(2, "West Town", "<BODY><SIZE=3>individual games<END>",Area.STATUS_ACTIVE));
}
// how many areas do we have ?
public int getAreaCount() {
return areas.size();
}
public String getName(int areanumber) {
Area area = (Area) areas.get(areanumber-1);
return(area.getName());
}
public String getDescription(int areanumber) {
Area area = (Area) areas.get(areanumber-1);
return(area.getDescription());
}
public byte getStatus(int areanumber) {
Area area = (Area) areas.get(areanumber-1);
return(area.getStatus());
}
}

View File

@@ -0,0 +1,41 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.channels.SocketChannel;
/**
* Object for the request queue
*/
public class ChangeRequest {
public static final int REGISTER = 1;
public static final int CHANGEOPS = 2;
public SocketChannel socket;
public int type;
public int ops;
public ChangeRequest(SocketChannel socket, int type, int ops) {
this.socket = socket;
this.type = type;
this.ops = ops;
}
}

165
bioserver/Client.java Normal file
View File

@@ -0,0 +1,165 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
/**
* information about the clients
*/
public class Client {
private SocketChannel socket;
private String userid;
private String session;
private HNPair hnpair; // chosen handle / nickname
private byte[] characterstats; // 0xd0 in len
private short character;
private short costume;
private int area; // special case 51 = post-game lobby
private int room;
private int slot;
public int gamenumber;
private byte player; // number of this player (1-4)
public boolean connalive; // set back every 60 secs or be disconnected ;-)
private byte host; // this is the host of a gameslot
public Client(SocketChannel socket, String userid, String session) {
this.socket = socket;
this.userid = userid;
this.session = session;
this.area = 0; // in no area (area selection screen)
this.room = 0; // in no room
this.slot = 0; // in no slot
this.host = 0;
this.connalive = true; // begin with active connection
}
public SocketChannel getSocket() {
return socket;
}
public String getUserID() {
return userid;
}
public HNPair getHNPair() {
return hnpair;
}
public void setHNPair(HNPair hnpair) {
this.hnpair = hnpair;
}
public void setCharacterStats(byte[] charstats) {
this.characterstats = charstats;
this.character = (short) (charstats[0xc8] & 0x00ff);
// npc start with MAC = 9
this.character = (short) (this.character + (short) (8 * charstats[0xca] & 0x00ff));
this.costume = (short) (charstats[0xcc] & 0x00ff);
}
public void setArea(int number) {
this.area = number;
}
public int getArea() {
return this.area;
}
public void setRoom(int number) {
this.room = number;
}
public int getRoom() {
return this.room;
}
public void setSlot(int number) {
this.slot = number;
}
public int getSlot() {
return this.slot;
}
public byte[] getCharacterStats() {
return this.characterstats;
}
public byte getHostFlag() {
return this.host;
}
public void setHostFlag(byte number) {
this.host = number;
}
public void setPlayerNum(byte number) {
this.player = number;
}
public byte getPlayerNum() {
return this.player;
}
public byte[] getPreGameStat(byte playernum) {
ByteBuffer z = ByteBuffer.wrap(new byte[300]);
z.put(playernum);
z.put((byte) 1);
z.put(this.getHNPair().getHNPair());
z.putShort((short) this.characterstats.length);
z.put(this.characterstats);
z.put((byte) 0);
z.put((byte) 0);
z.put((byte) 6);
byte[] retval = new byte[z.position()];
z.rewind();
z.get(retval);
return retval;
}
public byte[] getCharacterStat() {
ByteBuffer z = ByteBuffer.wrap(new byte[300]);
z.put(this.getHNPair().getHNPair());
z.putShort((short) this.characterstats.length);
z.put(this.characterstats);
byte[] retval = new byte[z.position()];
z.rewind();
z.get(retval);
return retval;
}
public short getCharacter() {
return this.character;
}
public short getCostume() {
return this.costume;
}
}

243
bioserver/ClientList.java Normal file
View File

@@ -0,0 +1,243 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* List of connected clients
*/
public class ClientList {
private List clients;
private Client client;
public ClientList() {
clients = new LinkedList();
}
public List getList() {
return clients;
}
public void add(Client client) {
clients.add(client);
}
// find a client by its sockets
public Client findClient(SocketChannel socket) {
for(int i=0; i< clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getSocket() == socket) {
return(client);
}
}
return null;
}
// find a client by userid
public Client findClient(String userid) {
for(int i=0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getUserID().equals(userid)) return client;
}
return null;
}
// find a client by its handle
public Client findClientByHandle(byte[] handle) {
byte[] clhand;
if(handle == null) return null;
for(int i=0; i<clients.size(); i++) {
client = (Client) clients.get(i);
try {
clhand = client.getHNPair().getHandle();
} catch (Exception e) {
//TODO: for the moment we ignore the nullpointer execeptions, but we have to handle clientlist different!
clhand = null;
}
if(clhand != null)
if(Arrays.equals(handle, clhand)) return client;
}
return null;
}
// find client with certain playernumber in same gameslot like client
public Client findClient(int area, int room, int slot, byte playernum) {
for(int i=0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getArea()==area &&
client.getRoom()==room &&
client.getSlot()==slot &&
client.getPlayerNum() == playernum) { return(client); }
}
return null;
}
public byte getFreePlayerNum(int area, int room, int slot) {
byte[] fpn = {0,0,0,0,0};
for(int i=0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getArea()==area && client.getRoom()==room && client.getSlot()==slot) {
fpn[client.getPlayerNum()] = 1;
}
}
for(int i=2; i<5; i++) if(fpn[i] == 0) return((byte) i);
return(0);
}
// find a client by its socket and remove it
public void remove(SocketChannel socket) {
for(int i=0; i< clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getSocket() == socket) {
clients.remove(i);
continue;
}
}
}
// remove a client
public void remove(Client cl) {
for(int i=0; i< clients.size(); i++) {
client = (Client) clients.get(i);
if(client == cl) {
clients.remove(i);
continue;
}
}
}
// find the host of a slot if there's any
public Client getHostofSlot(int area, int room, int slot) {
Client retval = null;
for(int i=0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getArea()==area && client.getRoom()==room && client.getSlot()==slot && client.getHostFlag()==1) {
return client;
}
}
return retval;
}
public byte[] getPlayerStats(int area, int room, int slotnr) {
ByteBuffer retval = ByteBuffer.wrap(new byte[1024]);
byte playercnt = (byte) (this.countPlayersInSlot(area, room, slotnr) & 0xff);
retval.putShort((short) slotnr);
retval.put((byte) 3); // ???
retval.put(playercnt);
for(int i = 0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getArea()==area && client.getRoom()==room && client.getSlot() == slotnr) {
retval.put(client.getHNPair().getHNPair());
retval.putShort((short)client.getCharacterStats().length);
retval.put(client.getCharacterStats());
}
}
byte[] r = new byte[retval.position()];
retval.rewind();
retval.get(r);
return r;
}
// count players in a specific game
public int countPlayersInGame(int gamenr) {
int retval = 0;
for(int i = 0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.gamenumber == gamenr) retval++;
}
return retval;
}
// Count players in given slot
public int countPlayersInSlot(int area, int room, int slotnr) {
int retval = 0;
for(int i = 0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getArea() == area && client.getRoom() == room && client.getSlot() == slotnr) retval++;
}
return retval;
}
// Count players in given room
public int countPlayersInRoom(int area, int room) {
int retval = 0;
for(int i = 0; i<clients.size(); i++) {
client = (Client) clients.get(i);
if(client.getArea() == area && client.getRoom() == room) retval++;
}
return retval;
}
// count players in a given meeting room
public byte getPlayerCountAgl(int nr) {
byte retval = 0;
for(int i=0; i<clients.size(); i++)
if(((Client)clients.get(i)).gamenumber == nr)
retval++;
return retval;
}
// count the players in a given area lobby
public int[] countPlayersInArea(int nr) {
// TODO: find out the unknown 3rd value. is it ingame ?
int retval[] = {0,0,0}; // arealobby, arearoom, ingame?
for(int i=0; i<clients.size(); i++) {
// right area
if(((Client)clients.get(i)).getArea() == nr) {
// in lobby or in room ?
if(((Client)clients.get(i)).getRoom() == 0) {
retval[0]++;
}
else {
retval[1]++;
}
} else {
if (((Client)clients.get(i)).getArea() == 51) {
retval[2]++;
}
}
}
return retval;
}
public byte getClientStatus(byte[] handle) {
Client cl = this.findClientByHandle(handle);
// offline or playing
if(cl == null) return 0;
// ingame
if(cl.gamenumber != 0) return 3;
// assume online
return 1;
}
}

152
bioserver/Commands.java Normal file
View File

@@ -0,0 +1,152 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
// Definitions for the protocol
public class Commands {
final static byte SERVER = (byte) 0x18; // a packet from the server
final static byte CLIENT = (byte) 0x81; // a packet from the client
final static byte GAMESERVER = (byte) 0x28; // a packet from the gameserver
final static byte GAMECLIENT = (byte) 0x82; // a packet from the gameclient
final static byte QUERY = 0x01; // ask a question
final static byte TELL = 0x02; // answer a question
final static byte BROADCAST = 0x10; // send a packet to all clients
final static int LOGIN = 0x6101;
final static int UNKN61A0 = 0x61A0; // TIMEOUTS ?
final static int CHECKVERSION = 0x6103; // check the clients version
final static int CHECKRND = 0x600E; // check random numbers
final static int UNKN61A1 = 0x61A1;
final static int IDHNPAIRS = 0x6131; // send available ID/HN pairs
final static int HNSELECT = 0x6132; // which pair shall be used
final static int UNKN6104 = 0x6104;
final static int MOTHEDAY = 0x614C; // message of the day, kind of html/xml used
final static int CHARSELECT = 0x6190; // selected char and its statistics
final static int UNKN6881 = 0x6881;
final static int UNKN6882 = 0x6882;
final static int RANKINGS = 0x6145; // playerranking one can see in the area lobby
final static int UNKN6141 = 0x6141;
final static int AREACOUNT = 0x6203; // how many areas has this server
final static int AREAPLAYERCNT = 0x6205; // number of players in the area
final static int AREASTATUS = 0x6206; // area available (0) or locked (3)
final static int AREANAME = 0x6204; // name of the area
final static int AREADESCRIPT = 0x620A; // descripton of the area
final static int HEARTBEAT = 0x6202; // send every 30 secs to the clients
final static int AREASELECT = 0x6207; // choose area
final static int EXITAREA = 0x6209; // leave the roomlist (back to arealist)
final static int ROOMSCOUNT = 0x6301; // rooms in area
final static int ROOMPLAYERCNT = 0x6303;
final static int ROOMSTATUS = 0x6304; // status of a room
final static int ROOMNAME = 0x6302; // Name of a room
final static int UNKN6308 = 0x6308;
final static int ENTERROOM = 0x6305;
final static int SLOTCOUNT = 0x6401; // How many gameslots are in the room ?
final static int SLOTPLRSTATUS = 0x6403; // how many players are in slot / available in slot ?
final static int SLOTSTATUS = 0x6404; // is slot available, used or full ?
final static int SLOTTITLE = 0x6402; // title of the gameslot
final static int SLOTATTRIB2 = 0x640B;
final static int SLOTPWDPROT = 0x6405; // flag for password protection
final static int SLOTSCENTYPE = 0x650A; // scenario and type (DVD/HDD) for this slot
final static int RULESCOUNT = 0x6603; // how many rules are there for slot ?
final static int RULEATTCOUNT = 0x6607; // how many attributes has a rule ?
final static int UNKN6601 = 0x6601;
final static int UNKN6602 = 0x6602;
final static int RULEDESCRIPT = 0x6604; // name of the rule
final static int RULEVALUE = 0x6606; // get value of rule
final static int RULEATTRIB = 0x6605; // additional attribute 2 of rule
final static int ATTRDESCRIPT = 0x6608; // name of the choice
final static int ATTRATTRIB = 0x660E; // attribute of the choice (always 0?)
final static int PLAYERSTATS = 0x640A; // statistics of players in room
final static int EXITSLOTLIST = 0x6408; // leave the slotlist (back to roomlist)
final static int CREATESLOT = 0x6407; // create a new slot
final static int SCENESELECT = 0x6509; // select scenario for slot
final static int SLOTNAME = 0x6609; // set name of the slot
final static int SETRULE = 0x660B; // set rule for gameslot
final static int UNKN660C = 0x660C;
final static int SLOTTIMER = 0x6409; // wait time for a gameslot
final static int UNKN6412 = 0x6412;
final static int UNKN6504 = 0x6504;
final static int CANCELSLOT = 0x6501; // cancel game in slot
final static int LEAVESLOT = 0x6502; // leave slot
final static int PLAYERSTATBC = 0x6503; // broadcasting statistics of a joining player
final static int CANCELSLOTBC = 0x6505; // broadcast when host cancels slot
final static int PLAYEROK = 0x6506; // broadcast when player is "unlocked"
final static int STARTGAME = 0x6508; // broadcast by host when game will be started
final static int CHATIN = 0x6701; // chat message from a client
final static int CHATOUT = 0x6702; // chat mesage from server
final static int GETREADY = 0x6910; // broadcasted by server, clients request game details then
final static int PLAYERCOUNT = 0x6911; // total number of players for the gamesession
final static int PLAYERNUMBER = 0x6912; // number of player
final static int PLAYERSTAT = 0x6913; // statistic of a player in slot
final static int PLAYERSCORE = 0x6917; // scoring from the ranklist for a player
final static int GAMESESSION = 0x6915; // the session number for this game
final static int GAMEDIFF = 0x6914; // difficulty of the game
final static int GSINFO = 0x6916; // gameserver info (192.168.2.1:8590)
final static int UNKN6002 = 0x6002;
final static int ENTERAGL = 0x6210; // entering the aftergame
final static int AGLSTATS = 0x6213; // stats after the game
final static int AGLPLAYERCNT = 0x6212; // number of players in aftergame lobby
final static int LEAVEAGL = 0x6211; // leave after game lobby ?
final static int JOINGAME = 0x6406; // joining a slot not as host
final static int AGLLEAVE = 0x6214; // broadcasting that a player left
final static int AGLJOIN = 0x6215; // broadcast stats of client to aftergame lobby
final static int GETINFO = 0x6801; // request the information
final static int EVENTDAT = 0x670D;
final static int EVENTDATBC = 0x670E;
final static int BUDDYLIST = 0x6707; // check status of a buddy
final static int CHECKBUDDY = 0x6703; // online status checker
final static int PRIVATEMSG = 0x6704; // private messaging
final static int PRIVATEMSGBC = 0x6705; // broadcast of the private msg
final static int UNKN6181 = 0x6181; // unknown, deep in the database functions ...
// something along registration ?
final static int CONNCHECK = 0x6001; // send every 60 secs to client
final static int LOGOUT = 0x6006;
final static int SLOTPASSWD = 0x660A; // set passowrd for slot
final static int POSTGAMEINFO = 0x6138; // statistics for the played game, used for rankings
final static int PATCHSTART = 0x6121; // indicates the start of a ptch file
final static int PATCHDATA = 0x6122; // block of 0x100 bytes patch
final static int PATCHFOOTER = 0x6123; // indicate the end of a patch file
final static int PATCHLINECHECK = 0x6124; // after 8 blocks of patchdata this check packet occurs
final static int PATCHFINISH = 0x6125; // done ...
final static int SHUTDOWN = 0x6003; // shutdown a client and put notice on screen
// packets for gameserver
final static int GSLOGIN = 0x1031; // first login packet for gameserver
}

View File

@@ -0,0 +1,69 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Configuration
* reads config.properties in the same directory folder
*/
public class Configuration {
public String gs_ip;
public String db_user;
public String db_password;
// constructor
public Configuration() {
InputStream inputStream = null;
Properties prop = new Properties();
String propFileName = "config.properties";
try {
inputStream = new FileInputStream(propFileName);
prop.load(inputStream);
this.gs_ip = prop.getProperty("gs_ip");
this.db_user = prop.getProperty("db_user");
this.db_password = prop.getProperty("db_password");
} catch (FileNotFoundException ex) {
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
System.out.println("Exception: " + e);
}
}
}
}
}

393
bioserver/Database.java Normal file
View File

@@ -0,0 +1,393 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.io.UnsupportedEncodingException;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* class for managing the database
*/
public class Database {
// TODO: read from ini-file, don't save credentials in class!
private final String url = "jdbc:mysql://localhost:3306/bioserver"
+"?useUnicode=true&characterEncoding=UTF-8";
private String user = "bioserver";
private String password = "xxxxxxxxxxxxxxxx";
private Connection con = null;
// simple constructor to create a reusable connection to the database
public Database(String db_user, String db_password) {
this.user = db_user;
this.password = db_password;
try {
con = (Connection) DriverManager.getConnection(url, user, password);
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
}
// setup some things on server restart
// set area to -1, rooms, slots and gamesessions to 0
this.setupDBrestart();
}
// test connection and create a new one on failure
private void testConnection() {
PreparedStatement pst = null;
try {
pst = (PreparedStatement) con.prepareStatement("select 1;");
pst.executeQuery();
} catch (SQLException ex) {
try {
if (pst != null) {
pst.close();
}
if (con != null) {
con.close();
}
} catch (SQLException e) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, e);
}
// create a new connection
try {
this.con = (Connection) DriverManager.getConnection(url, user, password);
} catch (SQLException ex1) {
Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex1);
}
}
}
// get userid of an existing session
public String getUserid(String sessid) {
ResultSet rs = null;
PreparedStatement pst = null;
// check it out ;-)
this.testConnection();
String retval = "";
try {
pst = (PreparedStatement) con.prepareStatement(String.format("select userid from sessions where sessid='%s'", sessid));
rs = pst.executeQuery();
if(rs.next()){
retval = rs.getString("userid");
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
return retval;
}
// get handle/nickname list for a given userid
public HNPairs getHNPairs(String userid) {
ResultSet rs = null;
PreparedStatement pst = null;
HNPairs hns = new HNPairs();
String nickname;
try {
pst = (PreparedStatement) con.prepareStatement(String.format("select handle,nickname from hnpairs where userid='%s' limit 0,3", userid));
rs = pst.executeQuery();
while(rs.next()){
hns.add(new HNPair(rs.getString("handle"), rs.getString("nickname")));
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
return hns;
}
// check if a handles exists
// returns true when handle is free
public boolean checkHandle(String handle) {
ResultSet rs = null;
PreparedStatement pst = null;
boolean retval = false;
try {
pst = (PreparedStatement) con.prepareStatement(String.format("select count(*) as cnt from hnpairs where handle='%s'", handle));
rs = pst.executeQuery();
if(rs.next()){
if(rs.getInt("cnt") == 0) retval=true;
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
return retval;
}
// insert a new handle/nickname into database
public void createNewHNPair(Client cl) {
ResultSet rs = null;
PreparedStatement pst = null;
try {
String nickname;
try {
nickname = new String(cl.getHNPair().getNickname(),"SJIS");
} catch (UnsupportedEncodingException ex) {
nickname = "sjis";
}
pst = (PreparedStatement) con.prepareStatement(String.format("insert into hnpairs (userid,handle,nickname) values ('%s','%s','%s')",
cl.getUserID(), new String(cl.getHNPair().getHandle()), nickname));
pst.executeUpdate();
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
}
// update handle/nickname of a client
public void updateHNPair(Client cl) {
ResultSet rs = null;
PreparedStatement pst = null;
String nickname;
try {
nickname = new String(cl.getHNPair().getNickname(),"SJIS");
} catch (UnsupportedEncodingException ex) {
nickname = "sjis";
}
try {
pst = (PreparedStatement) con.prepareStatement(String.format("update hnpairs set nickname='%s' where userid='%s' and handle='%s'",
nickname, cl.getUserID(), new String(cl.getHNPair().getHandle())));
pst.executeUpdate();
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
}
// set area, room, slot for a user
private void setupDBrestart() {
ResultSet rs = null;
PreparedStatement pst = null;
try {
pst = (PreparedStatement) con.prepareStatement("update sessions set area=-1, room=0, slot=0, gamesess=0, state=0");
pst.executeUpdate();
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
}
// set area, room, slot for a user and a state
public void updateClientOrigin(String userid, int state, int area, int room, int slot) {
ResultSet rs = null;
PreparedStatement pst = null;
try {
pst = (PreparedStatement) con.prepareStatement("update sessions set state=?, area=?, room=?, slot=? where userid=?");
pst.setInt(1, state);
pst.setInt(2, area);
pst.setInt(3, room);
pst.setInt(4, slot);
pst.setString(5, userid);
pst.executeUpdate();
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
}
// set game for a user
public void updateClientGame(String userid, int gamenumber) {
ResultSet rs = null;
PreparedStatement pst = null;
try {
String gamenum = (new Integer(gamenumber)).toString(); // TODO: I hate Java for this!
pst = (PreparedStatement) con.prepareStatement(String.format("update sessions set gamesess='%s' where userid='%s'", gamenum, userid));
pst.executeUpdate();
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
}
// get the gamenumber of a given userid
public int getGameNumber(String userid) {
ResultSet rs = null;
PreparedStatement pst = null;
int retval = 0;
try {
pst = (PreparedStatement) con.prepareStatement(String.format("select gamesess from sessions where userid='%s'", userid));
rs = pst.executeQuery();
if(rs.next()){
retval = rs.getInt("gamesess");
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
return retval;
}
// get message of the day
public String getMOTD() {
ResultSet rs = null;
PreparedStatement pst = null;
// check it out ;-)
this.testConnection();
String retval = "";
try {
pst = (PreparedStatement) con.prepareStatement("select message from motd where active=1 order by id desc limit 0,1");
rs = pst.executeQuery();
if(rs.next()){
retval = rs.getString("message");
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
} finally {
try {
if(rs != null) {
rs.close();
}
if(pst != null) {
pst.close();
}
} catch (SQLException ex) {
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
}
}
return retval;
}
}

View File

@@ -0,0 +1,38 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.channels.SocketChannel;
/**
* Object for the packet server is sending
*/
class GameServerDataEvent {
public GameServerThread server;
public SocketChannel socket;
public byte[] data;
public GameServerDataEvent(GameServerThread server, SocketChannel socket, byte[] data) {
this.server = server;
this.socket = socket;
this.data = data;
}
}

View File

@@ -0,0 +1,246 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.channels.SocketChannel;
import java.util.LinkedList;
import java.util.List;
/**
* Process messages
*/
class GameServerPacketHandler implements Runnable {
// database for sessionhandling
private Database db;
// the list with packets :-)
private List queue = new LinkedList();
// list of connected clients
private ClientList clients = new ClientList();
// server packet id if needed
private int packetidcounter;
@Override
public void run() {
GameServerDataEvent dataEvent;
// get configuration
Configuration conf = new Configuration();
this.db = new Database(conf.db_user, conf.db_password);
packetidcounter = 0;
while(true) {
// Wait for data to become available
synchronized(queue) {
while(queue.isEmpty()) {
try {
queue.wait();
} catch (InterruptedException e) { }
}
dataEvent = (GameServerDataEvent) queue.remove(0);
}
// send the data
dataEvent.server.send(dataEvent.socket, dataEvent.data);
}
}
public int countInGamePlayers () {
return clients.getList().size();
}
// simple getter to let the serverthread manage disconnected clients
public ClientList getClients() {
return clients;
}
// increase the server packet id
public int getNextPacketID() {
return(++packetidcounter);
}
// here comes the raw packet data and is tranformed into messages
void processData(GameServerThread server, SocketChannel socket, byte[] data, int count) {
switch(data[0]) {
case (byte)0x82:
if(data[1] == 0x02) {
// some session checking etc.
Packet p = new Packet(data);
if(p.getCmd() == Commands.GSLOGIN) {
// check this session and if ok create client
if(!check_session(server, socket, p)) {
Logging.println("Session check gameserver failed!");
}
}
}
break;
default:
// broadcast to connected clients in gamesession but not the sender
byte[] acopy = new byte[count];
System.arraycopy(data, 0, acopy, 0, count);
Client cl = clients.findClient(socket);
cl.connalive = true;
int gamenum = cl.gamenumber;
List cls = clients.getList();
synchronized(queue) {
for(int i=0; i<cls.size(); i++) {
cl = (Client) cls.get(i);
if(cl.gamenumber==gamenum && cl.getSocket()!=socket) {
queue.add(new GameServerDataEvent(server, cl.getSocket(), acopy));
}
}
queue.notify();
}
}
}
// add a packet to the queue
void addOutPacket(GameServerThread server, SocketChannel socket, Packet packet) {
synchronized(queue) {
queue.add(new GameServerDataEvent(server, socket, packet.getPacketData()));
queue.notify();
}
}
// broadcast a packet to all connected clients
void broadcastPacket(GameServerThread server, Packet packet) {
List cls = clients.getList();
synchronized(queue) {
for(int i=0; i<cls.size(); i++) {
Client cl = (Client) cls.get(i);
queue.add(new GameServerDataEvent(server, cl.getSocket(), packet.getPacketData()));
}
queue.notify();
}
}
public void GSsendLogin(GameServerThread server, SocketChannel socket) {
Packet p = new Packet(Commands.GSLOGIN, Commands.QUERY, Commands.GAMESERVER, this.getNextPacketID());
this.addOutPacket(server, socket, p);
}
// check the login for gameserver!
private boolean check_session(GameServerThread server, SocketChannel socket, Packet p) {
int seed = p.getPacketID();
int sessA = ((int) p.getPayload()[0] - 0x30)*10000
+((int) p.getPayload()[1] - 0x30)*1000
+((int) p.getPayload()[2] - 0x30)*100
+((int) p.getPayload()[3] - 0x30)*10
+((int) p.getPayload()[4] - 0x30);
int sessB = ((int) p.getPayload()[5] - 0x30)*10000
+((int) p.getPayload()[6] - 0x30)*1000
+((int) p.getPayload()[7] - 0x30)*100
+((int) p.getPayload()[8] - 0x30)*10
+((int) p.getPayload()[9] - 0x30);
String session = String.format("%04d%04d", sessA-seed, sessB-seed);
String userid = db.getUserid(session);
int gamenr = 0;
Client cl;
// session check is OK, a user with this session is in database
if(!"".equals(userid)) {
// kill old connections of this client
cl = clients.findClient(userid);
if(cl != null) {
List cls = clients.getList();
for(int i=0; i<cls.size(); i++) {
cl = (Client) cls.get(i);
if(cl.getUserID().equals(userid)) {
Logging.println("GS: Disconnect double session for userid "+userid);
server.disconnect(cl.getSocket());
this.removeClient(server, cl);
}
}
}
// setup client object for this user/session
gamenr = db.getGameNumber(userid);
clients.add((new Client(socket, userid, session)));
cl = clients.findClient(socket);
cl.gamenumber = gamenr;
// set this user to ingame status
db.updateClientOrigin(userid, PacketHandler.STATUS_GAME, 0, 0, 0);
return(true);
} else {
// the session check failed, disconnect this client
Logging.println("GS: Disconnect invalid session "+session+" for userid "+userid);
server.disconnect(socket);
return(false);
}
}
// remove client by userid
public void removeClient(GameServerThread server, String userid) {
Client cl = clients.findClient(userid);
if(cl == null) {
Logging.println("GS: kicking of " + userid + " failed, missing connection");
}
else {
this.removeClient(server, cl);
Logging.println("GS: " + userid + " kicked");
}
}
public void removeNoDisconnectClient(GameServerThread server, SocketChannel socket) {
Client cl = clients.findClient(socket);
// set user to offline status in database
db.updateClientOrigin(cl.getUserID(), PacketHandler.STATUS_OFFLINE, -1, 0, 0);
clients.remove(cl);
}
// when a host or client leaves unexpected, we have to handle this
public void removeClient(GameServerThread server, Client cl) {
if(cl == null) return;
SocketChannel socket = cl.getSocket();
// set user to offline status in database
db.updateClientOrigin(cl.getUserID(), PacketHandler.STATUS_OFFLINE, -1, 0, 0);
clients.remove(cl);
// close connection from server side
server.disconnect(socket);
}
// check for frozen players and remove their connection after one minute
public void connCheck(GameServerThread server) {
List cls = clients.getList();
for(int i=0; i<cls.size(); i++) {
Client cl = (Client) cls.get(i);
// check if connection is alive and initiate next check
// the connection flag is set to true by every incoming new packet
if(cl.connalive) {
cl.connalive = false;
} else {
// this client left us :-(
Logging.println("GS connCheck: trying to remove " + cl.getUserID());
this.removeClient(server, cl);
}
}
}
}

View File

@@ -0,0 +1,300 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.channels.spi.SelectorProvider;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
class GameServerThread implements Runnable {
// host:port combination to listen
private InetAddress hostAddress;
private int port;
// selector to monitor
private Selector selector;
// The channel on which we'll accept connections
private ServerSocketChannel serverChannel;
// thread of the packethandler
private GameServerPacketHandler packethandler;
// A list of ChangeRequest instances
private List changeRequests = new LinkedList();
// Maps a SocketChannel to a list of ByteBuffer instances
private Map pendingData = new HashMap();
// The buffer into which we'll read data when it's available
private ServerStreamBuffer readBuffer;
// Maps a SocketChannel to a ServerStreamBuffer (allows messaging)
private Map readbuffers = new HashMap();
// was initialisation ok ?
private boolean initOK;
// function to initialise the selector
private Selector initSelector() throws IOException {
// Create a new selector
Selector socketSelector = SelectorProvider.provider().openSelector();
// Create a new non-blocking server socket channel
this.serverChannel = ServerSocketChannel.open();
serverChannel.configureBlocking(false);
// Bind the server socket to the specified address and port
InetSocketAddress isa = new InetSocketAddress(this.hostAddress, this.port);
serverChannel.socket().bind(isa);
// Register the server socket channel, indicating an interest in
// accepting new connections
serverChannel.register(socketSelector, SelectionKey.OP_ACCEPT);
return socketSelector;
}
public GameServerThread(InetAddress hostAddress, int port, GameServerPacketHandler packethandler) {
this.initOK = true;
try {
this.hostAddress = hostAddress;
this.port = port;
this.selector = this.initSelector();
this.packethandler = packethandler;
} catch (IOException ex) {
Logging.println("Gameserver constructor exception caught!");
this.initOK = false;
}
}
// iteration of selector, deal accept, read and write
@Override
public void run() {
SelectionKey key;
while (this.initOK) {
try {
// Process any pending changes
synchronized(this.changeRequests) {
Iterator changes = this.changeRequests.iterator();
while (changes.hasNext()) {
ServerChangeEvent change = (ServerChangeEvent) changes.next();
key = change.socket.keyFor(this.selector);
if(key != null) {
if(key.isValid()) { // drop pending request for closed/cancelled channel
switch(change.type) {
case ServerChangeEvent.CHANGEOPS:
key.interestOps(change.ops);
break;
case ServerChangeEvent.FORCECLOSE:
this.close(key);
break;
default:
}
}
}
}
this.changeRequests.clear();
}
// Wait for an event on the registered channels
this.selector.select();
// Iterate over the set of keys for which events are available
Iterator selectedKeys = this.selector.selectedKeys().iterator();
while (selectedKeys.hasNext()) {
key = (SelectionKey) selectedKeys.next();
selectedKeys.remove();
if (!key.isValid()) {
continue;
}
// Check what event is available and deal with it
if (key.isValid() && key.isAcceptable()) {
this.accept(key);
} else if (key.isValid() && key.isReadable()) {
this.read(key);
} else if (key.isValid() && key.isWritable()) {
this.write(key);
}
}
} catch (Exception e) {
Logging.println("Gameserver iteration exception caught!");
}
}
}
// closing a connection
private void close(SelectionKey key) throws IOException {
try {
SocketChannel socketChannel = (SocketChannel) key.channel();
Logging.println("Gameserver closes connection to :" + socketChannel.getRemoteAddress());
key.channel().close();
key.cancel();
// cleanup
this.readbuffers.remove(socketChannel);
this.pendingData.remove(socketChannel);
this.packethandler.removeNoDisconnectClient(this, socketChannel);
} catch (Exception e) {
// nothing ...
}
}
// accepting a new connection
private void accept(SelectionKey key) throws IOException {
// For an accept to be pending the channel must be a server socket channel.
ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
// Accept the connection and make it non-blocking
SocketChannel socketChannel = serverSocketChannel.accept();
Socket socket = socketChannel.socket();
socketChannel.configureBlocking(false);
// Register the new SocketChannel with our Selector, indicating
// we'd like to be notified when there's data waiting to be read
socketChannel.register(this.selector, SelectionKey.OP_READ);
// and we need a readbuffer for this channel
if(readbuffers.get(socketChannel) == null) {
readbuffers.put(socketChannel, new ServerStreamBuffer());
}
// send the first packet to initiate the protocol
this.packethandler.GSsendLogin(this, socketChannel);
}
// read from socket
private void read(SelectionKey key) throws IOException {
SocketChannel socketChannel = (SocketChannel) key.channel();
int numRead;
// get the buffer for this channel
this.readBuffer = (ServerStreamBuffer) readbuffers.get(socketChannel);
try {
// read / append to buffer
numRead = socketChannel.read(this.readBuffer.buf);
} catch (IOException e) {
// The remote forcibly closed the connection, cancel
// the selection key and close the channel.
// also remove this client list
this.close(key);
return;
}
if (numRead == -1) {
// Remote entity shut the socket down cleanly. Do the
// same from our end and cancel the channel.
this.close(key);
return;
}
// Hand the data off to our worker thread
byte[] data = this.readBuffer.getCompleteGameMessages();
if(data != null) this.packethandler.processData(this, socketChannel, data, data.length);
}
// write to socket
private void write(SelectionKey key) throws IOException {
SocketChannel socketChannel = (SocketChannel) key.channel();
synchronized (this.pendingData) {
List queue = (List) this.pendingData.get(socketChannel);
// Write until there's not more data ...
while (!queue.isEmpty()) {
ByteBuffer buf = (ByteBuffer) queue.get(0);
try {
socketChannel.write(buf);
} catch (Exception e) {
// something's wrong on writing, e.g. timeout
queue.clear();
this.close(key);
return;
}
if (buf.remaining() > 0) {
// ... or the socket's buffer fills up
queue.clear();
this.close(key);
return;
}
queue.remove(0);
}
if (queue.isEmpty()) {
// We wrote away all data, so we're no longer interested
// in writing on this socket. Switch back to waiting for
// data.
key.interestOps(SelectionKey.OP_READ);
}
}
}
// send to a connection
public void send(SocketChannel socket, byte[] data) {
synchronized (this.changeRequests) {
// Indicate we want the interest ops set changed
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.CHANGEOPS, SelectionKey.OP_WRITE));
// And queue the data we want written
synchronized (this.pendingData) {
List queue = (List) this.pendingData.get(socket);
if (queue == null) {
queue = new ArrayList();
this.pendingData.put(socket, queue);
}
queue.add(ByteBuffer.wrap(data));
}
}
// Finally, wake up our selecting thread so it can make the required changes
this.selector.wakeup();
}
// close a connection server sided
public void disconnect(SocketChannel socket) {
synchronized (this.changeRequests) {
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.FORCECLOSE, 0));
}
this.selector.wakeup();
}
}

84
bioserver/HNPair.java Normal file
View File

@@ -0,0 +1,84 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
/**
* Handle / Nickname pair
*/
public class HNPair {
private byte[] handle;
private byte[] nickname;
// constructor for given handle and nickname Byte
public HNPair(byte[] handle, byte[] nickname) {
this.handle = handle;
this.nickname = nickname;
}
// constructor for given handle and nickname array
public HNPair(String handle, String nickname) {
this.handle = handle.getBytes();
try {
this.nickname = nickname.getBytes("SJIS");
} catch (UnsupportedEncodingException ex) {
this.nickname = "sjis".getBytes();
}
}
// create a random handle
public void createHandle(Database db) {
byte[] d = ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ").getBytes();
boolean flag = false;
while(!flag) {
for(int i=0; i<6; i++) {
Double dd = 36*Math.random();
this.handle[i] = d[dd.intValue()];
}
flag = db.checkHandle(handle.toString());
}
}
public byte[] getHandle() {
return handle;
}
public byte[] getNickname() {
return nickname;
}
// create an array with the HNpair
public byte[] getHNPair() {
byte[] hnpair = new byte[handle.length + nickname.length + 4];
hnpair[0] = 0;
hnpair[1] = 6;
System.arraycopy(handle, 0, hnpair, 2, 6);
hnpair[8] = 0;
hnpair[9] = (byte) nickname.length;
System.arraycopy(nickname, 0, hnpair, 10, nickname.length);
return hnpair;
}
}

64
bioserver/HNPairs.java Normal file
View File

@@ -0,0 +1,64 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
/**
* special class for multiple HNPairs
*/
public class HNPairs {
// byte number of ids (max 3)
// int length id (6)
// string id
// int length
// string handle (16)
// word end marker
// for simplicity we create a maxmimum buffer for 3 handles
private byte[] hnpairs = new byte[85];
private int count;
private int length;
public HNPairs() {
count = 0;
length = 1;
}
public byte[] getArray() {
hnpairs[0] = (byte) count; // set count
byte[] retval = new byte[length];
System.arraycopy(this.hnpairs, 0, retval, 0, length);
return retval;
}
// add a pair to buffer
public void add(HNPair hnpair) {
byte[] hn = hnpair.getHNPair();
System.arraycopy(hn, 0, hnpairs, length, hn.length);
length = length+hn.length;
hnpairs[length++] = 0;
hnpairs[length++] = 0; // add end marker
count++;
}
}

View File

@@ -0,0 +1,91 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Send a PING packet to all connected clients every 30 secs
*/
public class HeartBeatThread implements Runnable {
PacketHandler packethandler;
GameServerPacketHandler gspackethandler;
ServerThread server;
GameServerThread gsserver;
int counter, counter2;
public HeartBeatThread(ServerThread server, PacketHandler packethandler,
GameServerThread gsserver, GameServerPacketHandler packethandler2) {
this.packethandler = packethandler;
this.gspackethandler = packethandler2;
this.server = server;
this.gsserver = gsserver;
}
@Override
public void run() {
counter = 0;
counter2 = 0;
try {
Thread.sleep(10*1000);
} catch (InterruptedException ex) {
Logger.getLogger(HeartBeatThread.class.getName()).log(Level.SEVERE, null, ex);
}
// loop forever
while(true) {
try {
// servers send every 30 secs that he is alive, no answer needed
packethandler.broadcastPing(server);
// remove dead clients in gameserver
gspackethandler.connCheck(gsserver);
// also check if any slots have to be autostarted
packethandler.checkAutoStart(server);
// server asks for client every 60 secs
// client will be deleted from list and disconnected if not answered
if(counter == 1) {
packethandler.broadcastConnCheck(server);
counter = 0;
} else {
counter++;
}
// clean up the rooms every 5 minutes
if(counter2 == 9) {
packethandler.cleanGhostRooms(server);
counter2 = 0;
} else {
counter2++;
}
// sleep for 30 secs
Thread.sleep(30*1000);
} catch (InterruptedException ex) {
Logging.println("Heartbeat exception caught!");
}
}
}
}

110
bioserver/Information.java Normal file
View File

@@ -0,0 +1,110 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
/**
* Organize the urls in lobby
*
* preliminary class, we need url to data mapping
* currently always the same page is delivered
*
*/
public class Information {
// beware of the quotes, they need to be backslashed !
String contents_s =
"<HTML>"
+ "<HEAD>"
+ "<!--"
+ " <GAME-STYLE>"
+ " \"MOUSE=OFF\","
+ " \"SCROLL=OFF\","
+ " \"TITLE=OFF\","
+ " \"BACK=ON:mmbb://BUTTON_NG\","
+ " \"FORWARD=OFF\","
+ " \"CANCEL=OFF\","
+ " \"RELOAD=OFF\","
+ " \"CHOICE_MV=OFF\","
+ " \"X_SHOW=OFF\","
+ " \"FRONT_LABEL=ON:6\","
+ " </GAME-STYLE>"
+ "-->"
+ "<TITLE>database</TITLE><meta http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\"></HEAD>"
+ ""
+ "<BODY bgcolor=\"#000033\" text=#FFFFFF>"
+ "<!-- Choices -->"
+ "<br>"
+ "<IMG SRC=\"\" width=0 height=0 USEMAP=#CENTER_MAP BORDER=0>"
+ "<MAP NAME=CENTER_MAP>"
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164, 30,416, 60\" HREF=lbs://lbs/02/INFOR/INFOR00.HTM>"
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164, 92,416,118\" HREF=lbs://lbs/02/RANKING.HTM>"
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164,154,416,219\" HREF=afs://02/2>"
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164,216,416,266\" HREF=afs://02/4>"
+ "</MAP> "
+ ""
+ ""
+ "<table width=584 cellspacing=30 cellpadding=0>"
+ " <tr> "
+ " <td align=center>&nbsp;</td>"
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>INFORMATION</td>"
+ " <td align=center>&nbsp;</td>"
+ " </tr>"
+ " <tr> "
+ " <td align=center>&nbsp;</td>"
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>RANKING</td>"
+ " <td align=center>&nbsp;</td>"
+ " </tr>"
+ " <tr> "
+ " <td align=center>&nbsp;</td>"
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>TERMS OF USE</td>"
+ " <td align=center>&nbsp;</td>"
+ " </tr>"
+ " <tr> "
+ " <td align=center>&nbsp;</td>"
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>REGISTER / CHANGE</td>"
+ " <td align=center>&nbsp;</td>"
+ " </tr>"
+ "</table>"
+ "</BODY>"
+ "</HTML>";
public Information() {
}
// retrieve the desired URL
public byte[] getData(String url) {
byte[] content_b = null;
url = ("htm/"+url).replace("..", "X");
Logging.println("requested url: "+url);
try {
content_b = Files.readAllBytes(Paths.get(url));
} catch (IOException ex) {
Logging.println("Error reading file: "+url);
content_b = contents_s.getBytes();
}
return content_b;
}
}

62
bioserver/Logging.java Normal file
View File

@@ -0,0 +1,62 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.util.Date;
/*
* a simple class to print the hexdump of a byte buffer
*
*/
public class Logging {
// how many bytes should be shown in one line ?
private static final int WIDTH = 16;
public static void printBuffer(byte[] buffer, int length) {
int index = 0;
while(length>0) {
// print a full line or rest of the buffer
int j = Math.min(length, WIDTH);
for(int i=0; i<j; i++) System.out.printf("%02x ", buffer[index+i]);
for(int i=0; i<(WIDTH+1-j); i++) System.out.printf(" ");
for(int i=0; i<j; i++) {
char c = (char) buffer[index+i];
System.out.printf("%c", Character.isLetterOrDigit(c)||Character.isSpaceChar(c) ? c:'.');
}
System.out.printf("\n");
length -= WIDTH;
index += WIDTH;
}
}
// print the complete buffer
public static void printBuffer(byte[] buffer) {
printBuffer(buffer, buffer.length);
}
// print a message to console
public static void println(String msg) {
Date date = new Date();
System.out.println(date.toString()+" "+msg);
}
}

View File

@@ -0,0 +1,46 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
/**
* Object for Message of the day
*/
public class MessageOfTheDay {
private byte number;
private String message;
public MessageOfTheDay(int number, String message) {
this.message = message;
this.number = (byte) number;
}
public byte[] getPacket() {
byte[] retval = new byte[3 + message.length()];
retval[0] = number;
if(message.length() == 0) retval[0] = 0;
retval[1] = (byte)(message.length() >> 8);
retval[2] = (byte)(message.length() & 0xFF);
System.arraycopy(message.getBytes(), 0, retval, 3, message.length());
return(retval);
}
}

252
bioserver/Packet.java Normal file
View File

@@ -0,0 +1,252 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
public class Packet {
final static int HEADERSIZE = 12;
private byte who; // server or client packet
private byte qsw; // question or answer
private int cmd; // command
private int len; // length including header
private int pid; // packet ID
private byte err; // error occured
private byte[] pay; // the payload
// constructor with payload
public Packet(int command, byte questionanswer, byte whosends, int packetid, byte[] payload) {
cmd = command;
who = whosends;
qsw = questionanswer;
len = payload.length;
pid = packetid;
pay = payload;
err = 0;
}
// constructor without payload
public Packet(int command, byte questionanswer, byte whosends, int packetid) {
cmd = command;
who = whosends;
qsw = questionanswer;
len = 0;
pay = null;
pid = packetid;
err = 0;
}
// constructor for raw data
public Packet(byte[] packetdata) {
who = (byte) packetdata[0];
qsw = (byte) packetdata[1];
cmd = (((int) packetdata[2] << 8)&0xFF00) | ((int) packetdata[3] &0xFF);
len = (((int) packetdata[4] << 8)&0xFF00) | ((int) packetdata[5] &0xFF);
pid = (((int) packetdata[6] << 8)&0xFF00) | ((int) packetdata[7] &0xFF);
err = (byte) packetdata[8];
pay = new byte[len];
if((len + HEADERSIZE) > packetdata.length) {
System.out.println("ERROR: packet constructor!!\n");
Logging.printBuffer(packetdata);
}
System.arraycopy(packetdata, HEADERSIZE, pay, 0, len);
}
// construct the raw packet
public byte[] getPacketData() {
byte[] result = new byte[len + HEADERSIZE];
// build the header
result[0] = (byte) who;
result[1] = (byte) qsw;
result[2] = (byte) ((cmd >> 8) & 0xff);
result[3] = (byte) (cmd & 0xff);
result[4] = (byte) ((len >> 8) & 0xff);
result[5] = (byte) (len & 0xff);
result[6] = (byte) ((pid >> 8) & 0xff);
result[7] = (byte) (pid & 0xff);
result[8] = (byte) err;
result[9] = (byte) 0xff;
result[10] = (byte) 0xff;
result[11] = (byte) 0xff;
// copy the payload
if(len >0) System.arraycopy(pay, 0, result, HEADERSIZE, pay.length);
return result;
}
public int getLength() {
return len;
}
public int getCmd() {
return cmd;
}
public byte getqsw() {
return qsw;
}
public byte getwho() {
return who;
}
public int getPacketID() {
return pid;
}
public byte[] getPayload() {
return pay;
}
public void setPacketID(int packetid) {
this.pid = packetid;
}
// set the error flag for a packet !
public void setErr() {
this.err = (byte) 0xff;
}
private byte calc_shift(byte i, byte p) {
byte[] fixval = { 21, 23, 10, 17, 23, 19, 6, 13};
byte[] masks = {0x33, 0x30, 0x3c, 0x34, 0x2d, 0x30, 0x3c, 0x34};
return(byte) (fixval[i&7] - (i&(byte)0xf8) - p + ((p - 9 + i)&masks[i&7])*2);
}
// encrypt/decrypt the payload
// 2 bytes len, 2 bytes sum, rest string
public void cryptString() {
int length = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
for(int i=0; i<length; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
}
// return a byte array with decrypted string
public byte[] getDecryptedString() {
int length = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
for(int i=0; i<length; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
byte[] retval = new byte[length];
System.arraycopy(pay, 4, retval, 0, length);
return retval;
}
// decrypt the slotpassword
public byte[] getPassword() {
int length = (((int)pay[2] << 8)|((int)pay[3])) -2; // skip the sum
for(int i=0; i<length; i++) pay[6+i] = (byte) (pay[6+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
byte[] retval = new byte[length];
System.arraycopy(pay, 6, retval, 0, length);
return retval;
}
// decrypt chosen handle/nickname
public HNPair getDecryptedHNpair() {
int hlen = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
int nlen = (((int)pay[hlen +4] << 8)|((int)pay[hlen +5])) -2; // skip the sum
for(int i=0; i<hlen; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
for(int i=0; i<nlen; i++) pay[hlen+8+i] = (byte) (pay[hlen+8+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
byte[] handle = new byte[hlen];
byte[] nickname = new byte[nlen];
System.arraycopy(pay, 4, handle, 0, hlen);
System.arraycopy(pay, hlen+8, nickname, 0, nlen);
return(new HNPair(handle, nickname));
}
public byte[] getCharacterStats(){
for(int i=0; i<0xD0; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
byte[] retval = new byte[0xD0];
System.arraycopy(pay, 4, retval, 0, 0xD0);
return retval;
}
// this returns the first two bytes of the payload as int
public int getNumber() {
return((((int)pay[0] << 8)&0xFF00) | ((int)pay[1] & 0xFF));
}
// decrypts and returns chat data
public byte[] getChatOutData() {
this.cryptString();
int length = (((int)pay[0] << 8)|((int)pay[1])) -2;
byte[] retval = new byte[length];
System.arraycopy(pay, 4, retval, 0, length);
return retval;
}
// decrypts handle and event data in pregame and after game lobby
// and returns the broadcast data
public byte[] getEvenData() {
int hlen = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
int elen = ((((int)pay[hlen +4]&0xff) << 8)|((int)pay[hlen +5])&0xff) -2; // skip the sum
for(int i=0; i<hlen; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
for(int i=0; i<elen; i++) pay[hlen+8+i] = (byte) (pay[hlen+8+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
ByteBuffer z = ByteBuffer.wrap(new byte[hlen+elen+4]);
z.putShort((short)hlen);
z.put(pay,4,hlen);
z.putShort((short)elen);
z.put(pay,hlen+8,elen);
byte[] retval = new byte[z.position()];
z.rewind();
z.get(retval);
return retval;
}
// decrypt a private message and create broadcast in one step
public PrivateMessage getDecryptedPvtMess(Client sender) {
int hlen = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
int nlen = (((int)pay[hlen +4] << 8)|((int)pay[hlen +5])) -2; // skip the sum
for(int i=0; i<hlen; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
for(int i=0; i<nlen; i++) pay[hlen+8+i] = (byte) (pay[hlen+8+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
byte[] recipient = new byte[hlen];
byte[] message = new byte[nlen];
System.arraycopy(pay, 4, recipient, 0, hlen);
System.arraycopy(pay, hlen+8, message, 0, nlen);
return(new PrivateMessage(sender.getHNPair().getHandle(), sender.getHNPair().getNickname(), recipient, message));
}
// helper function
private int decryptBuff(byte[] b, int offset) {
int mlen = ((((int)b[offset]&0xff) << 8)|((int)b[offset+1]&0xff)) -2;
for(int i=0; i<mlen; i++) pay[offset+4+i] = (byte) (pay[offset+4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
return mlen;
}
// decrypt the version string
public byte[] getVersion() {
int length = (((int)pay[3] << 8)|((int)pay[4])) -2; // skip the sum
for(int i=0; i<length; i++) pay[7+i] = (byte) (pay[7+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
byte[] retval = new byte[length];
System.arraycopy(pay, 7, retval, 0, length);
return retval;
}
}

218
bioserver/Packet6881.java Normal file
View File

@@ -0,0 +1,218 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
/**
* A mysterious packet :D
*/
public class Packet6881 {
private static final byte[][] data = new byte[][]{
{
(byte) 0x01,(byte) 0x01,(byte) 0x01,(byte) 0x94,(byte) 0xAD,(byte) 0x90,(byte) 0xB6,(byte) 0x20,(byte) 0x20,(byte) 0x6F,(byte) 0x75,(byte) 0x74,(byte) 0x62,(byte) 0x72,(byte) 0x65,(byte) 0x61,(byte) 0x6B,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x09,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x05,(byte) 0x05,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x01,(byte) 0x02,(byte) 0x97,(byte) 0xEB,(byte) 0x89,(byte) 0xBA,(byte) 0x20,(byte) 0x20,(byte) 0x62,(byte) 0x65,(byte) 0x6C,
(byte) 0x6F,(byte) 0x77,(byte) 0x20,(byte) 0x66,(byte) 0x72,(byte) 0x65,(byte) 0x65,(byte) 0x7A,(byte) 0x69,(byte) 0x6E,(byte) 0x67,(byte) 0x20,(byte) 0x70,(byte) 0x6F,(byte) 0x69,(byte) 0x6E,(byte) 0x74,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x05,(byte) 0x03,(byte) 0x04,(byte) 0x03,(byte) 0x04,
(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0xB2,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x03,(byte) 0x01,(byte) 0x03,(byte) 0x91,(byte) 0x83,(byte) 0x8C,(byte) 0x41,(byte) 0x20,(byte) 0x20,(byte) 0x74,(byte) 0x68,(byte) 0x65,(byte) 0x20,(byte) 0x68,(byte) 0x69,(byte) 0x76,(byte) 0x65,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x04,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x02,(byte) 0x05,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x68,(byte) 0x01,(byte) 0x00,(byte) 0x00,(byte) 0x04,(byte) 0x01,(byte) 0x04,(byte) 0x8D,(byte) 0x96,(byte) 0x89,(byte) 0x8A,(byte) 0x20,
(byte) 0x20,(byte) 0x68,(byte) 0x65,(byte) 0x6C,(byte) 0x6C,(byte) 0x66,(byte) 0x69,(byte) 0x72,(byte) 0x65,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x05,
(byte) 0x02,(byte) 0x03,(byte) 0x02,(byte) 0x03,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x05,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x1E,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x05,(byte) 0x01,(byte) 0x05,(byte) 0x8C,(byte) 0x88,(byte) 0x88,(byte) 0xD3,(byte) 0x20,(byte) 0x20,(byte) 0x64,(byte) 0x65,(byte) 0x63,(byte) 0x69,(byte) 0x73,(byte) 0x69,(byte) 0x6F,(byte) 0x6E,(byte) 0x73,(byte) 0x2C,(byte) 0x20,
(byte) 0x64,(byte) 0x65,(byte) 0x63,(byte) 0x69,(byte) 0x73,(byte) 0x69,(byte) 0x6F,(byte) 0x6E,(byte) 0x73,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xD8,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x82,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x83,(byte) 0x03,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x84,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x85,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x86,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x87,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x88,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x89,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x8A,(byte) 0x03,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x8B,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x8C,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x8D,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xB5,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xDD,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x05,(byte) 0x04,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x2D,(byte) 0x04,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x06,(byte) 0x1F,(byte) 0x00,(byte) 0x53,(byte) 0x4C,(byte) 0x50,(byte) 0x4D,(byte) 0x2D,(byte) 0x36,(byte) 0x35,(byte) 0x34,(byte) 0x32,(byte) 0x38,(byte) 0x00,(byte) 0x00,
(byte) 0x53,(byte) 0x4C,(byte) 0x50,(byte) 0x4D,(byte) 0x2D,(byte) 0x36,(byte) 0x35,(byte) 0x34,(byte) 0x32,(byte) 0x39,(byte) 0x00,(byte) 0x00,(byte) 0x53,(byte) 0x4C,(byte) 0x50,(byte) 0x4D,(byte) 0x2D,(byte) 0x36,(byte) 0x35,(byte) 0x34,(byte) 0x33,(byte) 0x30,(byte) 0x00,(byte) 0x00,(byte) 0x42,(byte) 0x49,(byte) 0x4F,(byte) 0x48,
(byte) 0x41,(byte) 0x5A,(byte) 0x41,(byte) 0x52,(byte) 0x44,(byte) 0x20,(byte) 0x4F,(byte) 0x55,(byte) 0x54,(byte) 0x42,(byte) 0x52,(byte) 0x45,(byte) 0x41,(byte) 0x4B,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x42,(byte) 0x49,(byte) 0x4F,(byte) 0x48,(byte) 0x41,(byte) 0x5A,(byte) 0x41,(byte) 0x52,(byte) 0x44,(byte) 0x20,(byte) 0x4F,(byte) 0x55,(byte) 0x54,(byte) 0x42,(byte) 0x52,(byte) 0x45,(byte) 0x41,(byte) 0x4B,(byte) 0x20,(byte) 0x82,(byte) 0x51,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x42,(byte) 0x49,(byte) 0x4F,(byte) 0x48,(byte) 0x41,(byte) 0x5A,(byte) 0x41,(byte) 0x52,(byte) 0x44,(byte) 0x20,(byte) 0x4F,(byte) 0x55,(byte) 0x54,(byte) 0x42,(byte) 0x52,(byte) 0x45,(byte) 0x41,(byte) 0x4B,(byte) 0x20,(byte) 0x82,(byte) 0x52,(byte) 0x00,(byte) 0x00,(byte) 0x00,
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xE9,(byte) 0x95,(byte) 0xBD,(byte) 0x89,(byte) 0xB8,(byte) 0x82,(byte) 0xC8,(byte) 0x96,(byte) 0xE9,(byte) 0x81,(byte) 0x41,
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBB,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xCD,(byte) 0x83,(byte) 0x6F,(byte) 0x81,(byte) 0x5B,(byte) 0x82,(byte) 0xCC,(byte) 0x94,(byte) 0xE0,(byte) 0x82,(byte) 0xF0,(byte) 0x8A,(byte) 0x4A,
(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xE2,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xAB,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8B,(byte) 0xB0,
(byte) 0x95,(byte) 0x7C,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xA4,(byte) 0x96,(byte) 0xBC,(byte) 0x82,(byte) 0xCC,(byte) 0x81,(byte) 0x41,(byte) 0x8F,(byte) 0xB5,(byte) 0x82,(byte) 0xA9,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xB4,(byte) 0x82,(byte) 0xE9,(byte) 0x8B,(byte) 0x71,(byte) 0x81,(byte) 0x42,
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x89,(byte) 0xE4,(byte) 0x81,(byte) 0x58,(byte) 0x82,(byte) 0xC9,(byte) 0x82,(byte) 0xC5,(byte) 0x82,(byte) 0xAB,(byte) 0x82,(byte) 0xE9,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xCD,(byte) 0x81,(byte) 0x41,
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBD,(byte) 0x82,(byte) 0xBE,(byte) 0x93,(byte) 0xA6,(byte) 0x82,(byte) 0xB0,(byte) 0x98,(byte) 0x66,(byte) 0x82,(byte) 0xA4,(byte) 0x82,(byte) 0xB1,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xBE,
(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xBE,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x63,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8B,(byte) 0xB6,(byte) 0x91,(byte) 0x9B,
(byte) 0x82,(byte) 0xA9,(byte) 0x82,(byte) 0xE7,(byte) 0x93,(byte) 0xA6,(byte) 0x82,(byte) 0xEA,(byte) 0x81,(byte) 0x41,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x89,(byte) 0xE4,(byte) 0x81,(byte) 0x58,(byte) 0x82,(byte) 0xCD,(byte) 0x82,(byte) 0xC6,
(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xE9,(byte) 0x92,(byte) 0x6E,(byte) 0x89,(byte) 0xBA,(byte) 0x8E,(byte) 0x7B,(byte) 0x90,(byte) 0xDD,(byte) 0x82,(byte) 0xD6,(byte) 0x82,(byte) 0xC6,(byte) 0x97,(byte) 0x55,(byte) 0x82,(byte) 0xED,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xE9,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBB,(byte) 0x82,(byte) 0xB1,(byte) 0x82,(byte) 0xCD,(byte) 0x97,(byte) 0xE2,(byte) 0x8B,(byte) 0x43,(byte) 0x82,(byte) 0xC6,(byte) 0x90,(byte) 0xC3,(byte) 0x8E,(byte) 0xE2,(byte) 0x81,(byte) 0x41,(byte) 0x3C,(byte) 0x42,
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBB,(byte) 0x82,(byte) 0xB5,(byte) 0x82,(byte) 0xC4,(byte) 0x8E,(byte) 0x80,(byte) 0x82,(byte) 0xCC,(byte) 0x95,(byte) 0x61,(byte) 0x82,(byte) 0xAA,(byte) 0x96,(byte) 0xA0,(byte) 0x89,(byte) 0x84,(byte) 0x82,(byte) 0xB5,
(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8B,(byte) 0xA9,(byte) 0x8A,(byte) 0xAB,(byte) 0x82,(byte) 0xCC,(byte) 0x89,(byte) 0xCA,(byte) 0x82,(byte) 0xC4,
(byte) 0x81,(byte) 0x41,(byte) 0x82,(byte) 0xBD,(byte) 0x82,(byte) 0xC7,(byte) 0x82,(byte) 0xE8,(byte) 0x92,(byte) 0x85,(byte) 0x82,(byte) 0xAD,(byte) 0x90,(byte) 0x5E,(byte) 0x8E,(byte) 0xC0,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xCD,(byte) 0x84,(byte) 0x9F,(byte) 0x84,(byte) 0x9F,(byte) 0x81,(byte) 0x48,(byte) 0x3C,(byte) 0x45,
(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x96,(byte) 0x7B,(byte) 0x94,(byte) 0x5C,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xA4,(byte) 0x82,(byte) 0xB2,(byte) 0x82,(byte) 0xDF,(byte) 0x82,(byte) 0xAD,
(byte) 0x96,(byte) 0xB3,(byte) 0x90,(byte) 0x94,(byte) 0x82,(byte) 0xCC,(byte) 0x97,(byte) 0xA5,(byte) 0x93,(byte) 0xAE,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x81,(byte) 0x5C,(byte) 0x81,(byte) 0x5C,(byte) 0x88,(byte) 0xC3,(byte) 0x88,(byte) 0xC5,
(byte) 0x82,(byte) 0xCD,(byte) 0x8A,(byte) 0xF9,(byte) 0x82,(byte) 0xC9,(byte) 0x94,(byte) 0xDE,(byte) 0x82,(byte) 0xE7,(byte) 0x82,(byte) 0xC9,(byte) 0x8E,(byte) 0x78,(byte) 0x94,(byte) 0x7A,(byte) 0x82,(byte) 0xB3,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x42,
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x96,(byte) 0x82,(byte) 0x8C,(byte) 0x41,(byte) 0x82,(byte) 0xC6,(byte) 0x89,(byte) 0xBB,(byte) 0x82,(byte) 0xB5,(byte) 0x82,(byte) 0xBD,(byte) 0x95,(byte) 0x61,(byte) 0x89,(byte) 0x40,(byte) 0x82,(byte) 0xC5,
(byte) 0x81,(byte) 0x41,(byte) 0x9C,(byte) 0xDF,(byte) 0x82,(byte) 0xE8,(byte) 0x82,(byte) 0xC2,(byte) 0x82,(byte) 0xAD,(byte) 0x88,(byte) 0xAB,(byte) 0x96,(byte) 0xB2,(byte) 0x82,(byte) 0xF0,(byte) 0x92,(byte) 0xC7,(byte) 0x82,(byte) 0xA2,(byte) 0x95,(byte) 0xA5,(byte) 0x82,(byte) 0xA4,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xB1,(byte) 0x82,(byte) 0xCC,(byte) 0x8B,(byte) 0xB6,(byte) 0x91,(byte) 0xD4,(byte) 0x82,(byte) 0xCD,(byte) 0x81,(byte) 0x41,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xC2,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xC5,
(byte) 0x91,(byte) 0xB1,(byte) 0x82,(byte) 0xAD,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xA9,(byte) 0x81,(byte) 0x63,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8D,(byte) 0x95,(byte) 0x89,(byte) 0x8C,
(byte) 0x82,(byte) 0xC9,(byte) 0x95,(byte) 0xEF,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xBD,(byte) 0x83,(byte) 0x7A,(byte) 0x83,(byte) 0x65,(byte) 0x83,(byte) 0x8B,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,
(byte) 0x89,(byte) 0x8A,(byte) 0x82,(byte) 0xCD,(byte) 0x90,(byte) 0x6C,(byte) 0x82,(byte) 0xCC,(byte) 0x96,(byte) 0xB3,(byte) 0x97,(byte) 0xCD,(byte) 0x82,(byte) 0xB3,(byte) 0x82,(byte) 0xF0,(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xB4,(byte) 0x8F,(byte) 0xCE,(byte) 0x82,(byte) 0xA2,(byte) 0x81,(byte) 0x41,(byte) 0x3C,(byte) 0x42,
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x88,(byte) 0xD9,(byte) 0x8C,(byte) 0x60,(byte) 0x82,(byte) 0xCC,(byte) 0x8F,(byte) 0x62,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xC8,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xC4,(byte) 0x97,(byte) 0x78,(byte) 0x82,(byte) 0xE8,
(byte) 0x8B,(byte) 0xB6,(byte) 0x82,(byte) 0xA4,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xAD,(byte) 0x82,(byte) 0xAE,(byte) 0x82,(byte) 0xE8,(byte) 0x94,(byte) 0xB2,(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xCB,
(byte) 0x82,(byte) 0xCE,(byte) 0x81,(byte) 0x41,(byte) 0x8E,(byte) 0x80,(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xE9,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xDD,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x81,(byte) 0x5C,(byte) 0x81,(byte) 0x5C,
(byte) 0x8A,(byte) 0xE8,(byte) 0x82,(byte) 0xED,(byte) 0x82,(byte) 0xAD,(byte) 0x82,(byte) 0xCE,(byte) 0x88,(byte) 0xEA,(byte) 0x88,(byte) 0xAC,(byte) 0x82,(byte) 0xE8,(byte) 0x82,(byte) 0xCC,(byte) 0x97,(byte) 0x45,(byte) 0x8B,(byte) 0x43,(byte) 0x82,(byte) 0xC6,(byte) 0x8D,(byte) 0x4B,(byte) 0x89,(byte) 0x5E,(byte) 0x82,(byte) 0xF0,
(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8A,(byte) 0x58,(byte) 0x82,(byte) 0xC9,(byte) 0x94,(byte) 0x97,(byte) 0x82,(byte) 0xE9,(byte) 0x95,(byte) 0xF6,(byte) 0x89,(byte) 0xF3,(byte) 0x82,(byte) 0xCC,
(byte) 0x91,(byte) 0xAB,(byte) 0x89,(byte) 0xB9,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x97,(byte) 0xA7,(byte) 0x82,(byte) 0xBF,(byte) 0x82,(byte) 0xD3,(byte) 0x82,(byte) 0xB3,(byte) 0x82,(byte) 0xAA,(byte) 0x82,(byte) 0xE9,
(byte) 0x8E,(byte) 0xBD,(byte) 0x8D,(byte) 0x95,(byte) 0x82,(byte) 0xCC,(byte) 0x90,(byte) 0xE2,(byte) 0x96,(byte) 0x5D,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x89,(byte) 0x5E,(byte) 0x96,(byte) 0xBD,(byte) 0x82,(byte) 0xCC,
(byte) 0x8A,(byte) 0xF2,(byte) 0x98,(byte) 0x48,(byte) 0x82,(byte) 0xC5,(byte) 0x81,(byte) 0x41,(byte) 0x96,(byte) 0xC0,(byte) 0x82,(byte) 0xA2,(byte) 0x97,(byte) 0xAF,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xE9,(byte) 0x97,(byte) 0x50,(byte) 0x97,(byte) 0x5C,
(byte) 0x82,(byte) 0xCD,(byte) 0x82,(byte) 0xC8,(byte) 0x82,(byte) 0xA2,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x96,(byte) 0xE9,(byte) 0x96,(byte) 0xBE,(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xC6,
(byte) 0x82,(byte) 0xE0,(byte) 0x82,(byte) 0xC9,(byte) 0x96,(byte) 0x4B,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xE9,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xCD,(byte) 0x81,(byte) 0x41,(byte) 0x8A,(byte) 0xF3,(byte) 0x96,(byte) 0x5D,(byte) 0x82,(byte) 0xA9,(byte) 0x81,(byte) 0x41,(byte) 0x8F,(byte) 0x49,(byte) 0xE0,(byte) 0x81,
(byte) 0x82,(byte) 0xA9,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,
(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x50,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,
(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,
(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x51,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,
(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x52,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,
(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,
(byte) 0x53,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,
(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x54,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00
},
};
public static byte[] getData(int nr, int offset, int sizeL) {
byte[] d = new byte[sizeL + 11];
// check if more bytes are requested than left in buffer
if(sizeL > (data[nr].length-offset)) sizeL = data[nr].length - offset;
d[0] = (byte)nr;
d[1] = (byte)((offset>>24)&0xff);
d[2] = (byte)((offset>>16)&0xff);
d[3] = (byte)((offset>>8)&0xff);
d[4] = (byte)((offset)&0xff);
d[5] = (byte)((sizeL>>24)&0xff);
d[6] = (byte)((sizeL>>16)&0xff);
d[7] = (byte)((sizeL>>8)&0xff);
d[8] = (byte)((sizeL)&0xff);
d[9] = d[7];
d[10] = d[8];
System.arraycopy(data[nr], offset, d, 11, sizeL);
return(d);
}
}

2314
bioserver/PacketHandler.java Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
/**
* object for representation of strings in packetdata
*/
public class PacketString {
private byte[] buffer;
// construct it from a string
public PacketString(String string) {
this.buffer = string.getBytes();
}
// convert to data used in packets
public byte[] getData() {
ByteBuffer zwi = ByteBuffer.wrap(new byte[buffer.length + 2]);
zwi.putShort((short) buffer.length);
zwi.put(buffer);
return zwi.array();
}
}

81
bioserver/Patch.java Normal file
View File

@@ -0,0 +1,81 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* File#1 had a patch to version 1.01
* this class holds the patch data
*/
public class Patch {
// patch length is 0x7aa0
private byte[] patchData;
public Patch() {
try {
File file = new File("patch.raw");
this.patchData = new byte[(int) file.length()];
FileInputStream fis = new FileInputStream(file);
fis.read(this.patchData);
fis.close();
} catch (IOException ex) {
Logger.getLogger(Patch.class.getName()).log(Level.SEVERE, null, ex);
}
Logging.println("Patch loaded: " + this.patchData.length + " bytes");
}
public byte[] getData(int nr) {
// use a chunk of 0x100 bytes, last chunk might be different
int size = 0x100;
// check if more bytes are requested than left in buffer
if(this.patchData.length < (nr * 0x100 + 0x100)) size = patchData.length - (nr * 0x100);
if(size < 0 ) {
size = 0;
nr = 0;
}
byte[] d = new byte[size + 4];
// set chunk number and size
d[0] = (byte) ((nr >> 8) & 0xff);
d[1] = (byte) (nr & 0xff);
d[2] = (byte) ((size >> 8) & 0xff);
d[3] = (byte) (size & 0xff);
System.arraycopy(this.patchData, nr * 0x100, d, 4, size);
return(d);
}
// calculate the amount of chunks we can send
public int cntChunks(int nr) {
int max = 8;
int chunksLeft = (byte)((this.patchData.length - (nr * 0x100)) >> 8);
if(chunksLeft < 0) chunksLeft = 0;
if(chunksLeft < max) max = chunksLeft + 1;
return(max);
}
}

View File

@@ -0,0 +1,72 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
/**
* Object for the private messaging system
*/
public class PrivateMessage {
private byte[] senderhandle;
private byte[] sendername;
private byte[] recipient;
private byte[] message;
public PrivateMessage(byte[] senderhandle, byte[] sendername, byte[] recipient, byte[] message) {
this.senderhandle = senderhandle;
this.sendername = sendername;
this.recipient = recipient;
this.message = message;
}
public byte[] getRecipient() {
return this.recipient;
}
public byte[] getSenderHandle() {
return this.senderhandle;
}
public byte[] getMessage() {
return this.message;
}
// create a packet for broadcast
public byte[] getPacketData() {
ByteBuffer z = ByteBuffer.wrap(new byte[200]);
// handle and name of sender
z.putShort((short) senderhandle.length);
z.put(senderhandle);
z.putShort((short) sendername.length);
z.put(sendername);
// message
z.putShort((short) message.length);
z.put(message);
byte[] retval = new byte[z.position()];
z.rewind();
z.get(retval);
return retval;
}
}

52
bioserver/Room.java Normal file
View File

@@ -0,0 +1,52 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
/**
* Object for rooms within areas
*/
public class Room {
public static final byte STATUS_ACTIVE = 3;
public static final byte STATUS_INACTIVE = 0;
private int areanumber;
private String name;
private byte status;
public Room(int area, String name, byte status) {
this.name = name;
this.status = status;
this.areanumber = area;
}
public String getName() {
return this.name;
}
public byte getStatus() {
return this.status;
}
public int getAreaNumber() {
return this.areanumber;
}
}

65
bioserver/Rooms.java Normal file
View File

@@ -0,0 +1,65 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.util.LinkedList;
import java.util.List;
/**
* a class containing all rooms
*/
public class Rooms {
private List rooms;
private int numberOfAreas;
private final int numberOfRooms = 10;
public Rooms(int numberOfAreas) {
rooms = new LinkedList();
this.numberOfAreas = numberOfAreas;
for(int i=1; i<=numberOfAreas; i++) {
rooms.add(new Room(i, "R1", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R2", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R3", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R4", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R5", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R6", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R7", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R8", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "R9", Room.STATUS_ACTIVE));
rooms.add(new Room(i, "RA", Room.STATUS_ACTIVE));
}
}
public byte getStatus(int areanr, int roomnr) {
Room r = (Room) rooms.get((areanr-1)*this.numberOfRooms + roomnr-1);
return r.getStatus();
}
public String getName(int areanr, int roomnr) {
Room r = (Room) rooms.get((areanr-1)*this.numberOfRooms + roomnr-1);
return r.getName();
}
public int getRoomCount() {
return this.numberOfRooms;
}
}

170
bioserver/RuleSet.java Normal file
View File

@@ -0,0 +1,170 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
/**
* Object for a rule
* rules are organzied in rulesets
* each slot has one ruleset
*/
public class RuleSet {
public class Rule {
private String name;
private byte attribute; // TODO: what happens if <>1 ?
private byte value;
public Rule(String name, int attribute, int value){
this.name = name;
this.attribute = (byte) (attribute & 0xff);
this.value = (byte) (value & 0xff);
}
public String getName() {
return name;
}
public byte getAttribute() {
return attribute;
}
public byte getValue() {
return value;
}
public void setValue(byte value) {
this.value = value;
}
}
// standard setting
// four players, ten mins wait, very hard
public Rule[] ruleset = {
new Rule("number of players", 1, 2),
new Rule("wait limit", 1, 2),
new Rule("difficulty level", 1, 3),
new Rule("friendly fire", 1, 0),
};
public Rule[][] attributes = {
{
new Rule("two players", 0, 0),
new Rule("three players", 0, 0),
new Rule("four players", 0, 0)
}, {
new Rule("three minutes", 0, 0),
new Rule("five minutes", 0, 0),
new Rule("ten minutes", 0, 0),
new Rule("fifteen minutes", 0, 0),
new Rule("thirty minutes", 0, 0)
}, {
new Rule("easy", 0, 0),
new Rule("normal", 0, 0),
new Rule("hard", 0, 0),
new Rule("very hard", 0, 0)
}, {
new Rule("off", 0,0),
new Rule("on", 0,0),
}
};
public void RuleSet() {
};
// helper function to get a database field from the different rulesets of areas
public static String getRuleField(int area, byte rulenr) {
switch(rulenr) {
case 0: return("maxplayers");
case 1: return(null); //return("waittime");
case 2: return("difficulty");
case 3: return("friendlyfire");
default: return(null);
}
}
public void reset() {
// reset to standard
ruleset[0].setValue((byte) 2);
ruleset[1].setValue((byte) 2);
ruleset[2].setValue((byte) 3);
ruleset[3].setValue((byte) 0);
};
public String getRuleName(int nr) {
return ruleset[nr].getName();
};
public byte getRuleAttribute(int nr) {
return ruleset[nr].getAttribute();
};
public String getRuleAttName(int nr, int nratt) {
return attributes[nr][nratt].getName();
};
public byte getRuleAttAtt(int nr, int nratt) {
return attributes[nr][nratt].getAttribute();
};
public int getRulesCount() {
return ruleset.length;
}
public int getRulesAttCount(int rulenr) {
return attributes[rulenr].length;
}
public byte getRuleValue(int rulenr) {
return ruleset[rulenr].getValue();
}
public void setRuleValue(int rulenr, byte value) {
ruleset[rulenr].setValue(value);
}
public byte getDifficulty() {
return ruleset[2].getValue();
}
public byte getFriendlyFire() {
return ruleset[3].getValue();
}
public long getWaitTime() {
switch (ruleset[1].getValue()) {
case 0: return(3);
case 1: return(5);
case 2: return(10);
case 3: return(15);
case 4: return(30);
default: return(30);
}
}
public byte getNumberOfPlayers() {
switch (ruleset[0].getValue()) {
case 0: return(2);
case 1: return(3);
case 2: return(4);
default: return(2);
}
}
}

View File

@@ -0,0 +1,42 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.channels.SocketChannel;
/**
* Object for the request queue
*/
public class ServerChangeEvent {
public static final int REGISTER = 1;
public static final int CHANGEOPS = 2;
public static final int FORCECLOSE = 3;
public SocketChannel socket;
public int type;
public int ops;
public ServerChangeEvent(SocketChannel socket, int type, int ops) {
this.socket = socket;
this.type = type;
this.ops = ops;
}
}

View File

@@ -0,0 +1,38 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.channels.SocketChannel;
/**
* Object for the packet server is sending
*/
class ServerDataEvent {
public ServerThread server;
public SocketChannel socket;
public byte[] data;
public ServerDataEvent(ServerThread server, SocketChannel socket, byte[] data) {
this.server = server;
this.socket = socket;
this.data = data;
}
}

76
bioserver/ServerMain.java Normal file
View File

@@ -0,0 +1,76 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Main class for initialisation
*/
public class ServerMain {
// the server listens on this port
public final static int LOBBYPORT = 8300;
public final static int GAMEPORT = 8690; // if you change this, search for gs_info
// Entry point
public static void main(String[] args) {
System.out.println("------------------------------\n"+
"- fanmade server for -\n"+
"- Biohazard Outbreak File #1 -\n"+
"- -\n"+
"- (c) 2013-2019 obsrv.org -\n"+
"- no23@deathless.net -\n"+
"------------------------------\n");
// setup the packethandler in his own thread
PacketHandler packethandler = new PacketHandler();
new Thread(packethandler).start();
// create the server thread
ServerThread server = new ServerThread(null, LOBBYPORT, packethandler);
new Thread(server).start();
// create a simple gameserver
GameServerPacketHandler packethandler2 = new GameServerPacketHandler();
new Thread(packethandler2).start();
GameServerThread gsserver = new GameServerThread(null, GAMEPORT, packethandler2);
new Thread(gsserver).start();
// allow usage
packethandler.setGameServerPacketHandler(packethandler2);
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Logger.getLogger(ServerMain.class.getName()).log(Level.SEVERE, null, ex);
}
// last but not least
// create a thread for the keepalivepings and cleanups
new Thread(new HeartBeatThread(server, packethandler, gsserver, packethandler2)).start();
Date date = new Date();
System.out.println(date.toString()+" server started");
}
}

View File

@@ -0,0 +1,133 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.ByteBuffer;
/**
* handling of messages that were fragmented by tcp
*/
public class ServerStreamBuffer {
// maximum of packetsize to exspect
private static final int RECEIVESIZE = 8192;
// we need a ByteBuffer
public ByteBuffer buf = ByteBuffer.allocate(RECEIVESIZE);
// pointer to actual message
private int messptr;
public ServerStreamBuffer () {
this.messptr = 0;
}
// return a buffer with complete messages (lobby)
public byte[] getCompleteMessages() {
byte[] b = buf.array();
int size = this.buf.position()-this.messptr;
int total = 0;
int plen;
// enough data for a complete message?
if(size >= Packet.HEADERSIZE) {
// determine size of complete messages
while(size>0) {
// length of this mesage
plen = (((int) b[messptr+total+4] << 8)&0xFF00) | ((int) b[messptr+total+5] &0xFF);
size = size - plen - Packet.HEADERSIZE;
// if it's a full message, add to total
if(size >= 0) {
total = total + plen + Packet.HEADERSIZE;
}
}
} else {
// not enough data for a message
return null;
}
// total holds the size of our new buffer
byte[] retval = new byte[total];
System.arraycopy(b, messptr, retval, 0, total);
// size indicates fragmentation
if(size == 0) {
this.messptr = 0;
buf.clear();
} else {
// let's continue next time
this.messptr = this.messptr + total;
}
return retval;
}
// return a buffer with complete messages (gameserver)
public byte[] getCompleteGameMessages() {
byte[] b = buf.array();
// is it a gameplay packet to check, or a lobby packet ?
// for simplicity we assume that session packet is always complete!
if((b[0]==(byte)0x82) && (b[1]==0x02)) {
byte[] retval = new byte[buf.position()];
buf.rewind();
buf.get(retval);
this.buf.clear();
return retval;
}
int size = this.buf.position()-this.messptr;
int total = 0;
int plen;
// enough data for a complete message? at least 2 bytes needed!
if(size >= 1) {
// determine size of complete messages
while(size>0) {
// length of this mesage
plen = (byte) b[messptr+total] & 0x0FF;
size = size - plen;
// if it's a full message, add to total
if(size >= 0) {
total = total + plen;
}
}
} else {
// not enough data for a message
return null;
}
// total holds the size of our new buffer
byte[] retval = new byte[total];
System.arraycopy(b, messptr, retval, 0, total);
// size indicates fragmentation
if(size == 0) {
this.messptr = 0;
this.buf.clear();
} else {
// let's continue next time
this.messptr = this.messptr + total;
}
return retval;
}
}

304
bioserver/ServerThread.java Normal file
View File

@@ -0,0 +1,304 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.channels.spi.SelectorProvider;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* this thread handles connections and traffic queues
*/
class ServerThread implements Runnable {
// host:port combination to listen
private InetAddress hostAddress;
private int port;
// selector to monitor
private Selector selector;
// The channel on which we'll accept connections
private ServerSocketChannel serverChannel;
// thread of the packethandler
private PacketHandler packethandler;
// A list of ChangeRequest instances
private List changeRequests = new LinkedList();
// Maps a SocketChannel to a list of ByteBuffer instances
private Map pendingData = new HashMap();
// The buffer into which we'll read data when it's available
private ServerStreamBuffer readBuffer;
// Maps a SocketChannel to a ServerStreamBuffer (allows messaging)
private Map readbuffers = new HashMap();
// was initialisation ok ?
private boolean initOK;
// function to initialise the selector
private Selector initSelector() throws IOException {
// Create a new selector
Selector socketSelector = SelectorProvider.provider().openSelector();
// Create a new non-blocking server socket channel
this.serverChannel = ServerSocketChannel.open();
serverChannel.configureBlocking(false);
// Bind the server socket to the specified address and port
InetSocketAddress isa = new InetSocketAddress(this.hostAddress, this.port);
serverChannel.socket().bind(isa);
// Register the server socket channel, indicating an interest in
// accepting new connections
serverChannel.register(socketSelector, SelectionKey.OP_ACCEPT);
return socketSelector;
}
public ServerThread(InetAddress hostAddress, int port, PacketHandler packethandler) {
this.initOK = true;
try {
this.hostAddress = hostAddress;
this.port = port;
this.selector = this.initSelector();
this.packethandler = packethandler;
} catch (IOException ex) {
Logging.println("Lobbyserver constructor exception caught!");
this.initOK = false;
}
}
// iteration of selector, deal accept, read and write
@Override
public void run() {
SelectionKey key;
while (this.initOK) {
try {
// Process any pending changes
synchronized(this.changeRequests) {
Iterator changes = this.changeRequests.iterator();
while (changes.hasNext()) {
ServerChangeEvent change = (ServerChangeEvent) changes.next();
key = change.socket.keyFor(this.selector);
if(key != null) {
if(key.isValid()) { // drop pending request for closed/cancelled channel
switch(change.type) {
case ServerChangeEvent.CHANGEOPS:
key.interestOps(change.ops);
break;
case ServerChangeEvent.FORCECLOSE:
this.close(key);
break;
default:
}
}
}
}
this.changeRequests.clear();
}
// Wait for an event on the registered channels
this.selector.select();
// Iterate over the set of keys for which events are available
Iterator selectedKeys = this.selector.selectedKeys().iterator();
while (selectedKeys.hasNext()) {
key = (SelectionKey) selectedKeys.next();
selectedKeys.remove();
if (!key.isValid()) {
continue;
}
// Check what event is available and deal with it
if (key.isValid() && key.isAcceptable()) {
this.accept(key);
} else if (key.isValid() && key.isReadable()) {
this.read(key);
} else if (key.isValid() && key.isWritable()) {
this.write(key);
}
}
} catch (Exception e) {
Logging.println("Lobbyserver iteration exception caught!");
e.printStackTrace();
}
}
}
// closing a connection
private synchronized void close(SelectionKey key) throws IOException {
try {
SocketChannel socketChannel = (SocketChannel) key.channel();
Logging.println("Lobbyserver closes connection to :" + socketChannel.getRemoteAddress());
key.channel().close();
key.cancel();
// cleanup
this.readbuffers.remove(socketChannel);
this.pendingData.remove(socketChannel);
this.packethandler.removeClientNoDisconnect(this, socketChannel);
} catch (Exception e){
// nothing ...
}
}
// accepting a new connection
private void accept(SelectionKey key) throws IOException {
// For an accept to be pending the channel must be a server socket channel.
ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
// Accept the connection and make it non-blocking
SocketChannel socketChannel = serverSocketChannel.accept();
Socket socket = socketChannel.socket();
socketChannel.configureBlocking(false);
// Register the new SocketChannel with our Selector, indicating
// we'd like to be notified when there's data waiting to be read
socketChannel.register(this.selector, SelectionKey.OP_READ);
// and we need a readbuffer for this channel
if(readbuffers.get(socketChannel) == null) {
readbuffers.put(socketChannel, new ServerStreamBuffer());
}
// send the first packet to initiate the protocol
this.packethandler.sendLogin(this, socketChannel);
}
// read from socket
private void read(SelectionKey key) throws IOException {
SocketChannel socketChannel = (SocketChannel) key.channel();
int numRead;
// get the buffer for this channel
this.readBuffer = (ServerStreamBuffer) readbuffers.get(socketChannel);
try {
// read / append to buffer
numRead = socketChannel.read(this.readBuffer.buf);
} catch (IOException e) {
// The remote forcibly closed the connection, cancel
// the selection key and close the channel.
// also remove this client list
this.close(key);
return;
}
if (numRead == -1) {
// Remote entity shut the socket down cleanly. Do the
// same from our end and cancel the channel.
this.close(key);
return;
}
// Hand the data off to our worker thread
byte[] data = this.readBuffer.getCompleteMessages();
if(data != null) this.packethandler.processData(this, socketChannel, data, data.length);
}
// write to socket
private void write(SelectionKey key) throws IOException {
SocketChannel socketChannel = (SocketChannel) key.channel();
synchronized (this.pendingData) {
List queue = (List) this.pendingData.get(socketChannel);
// Write until there's no more data ...
while (!queue.isEmpty()) {
ByteBuffer buf = (ByteBuffer) queue.get(0);
try {
socketChannel.write(buf);
} catch (Exception e) {
// something's wrong on writing, e.g. timeout
queue.clear();
this.close(key);
return;
}
if (buf.remaining() > 0) {
// ... or the socket's buffer fills up
queue.clear();
this.close(key);
return;
}
queue.remove(0);
}
if (queue.isEmpty()) {
// We wrote away all data, so we're no longer interested
// in writing on this socket. Switch back to waiting for
// data.
key.interestOps(SelectionKey.OP_READ);
}
}
}
// send to a connection
public void send(SocketChannel socket, byte[] data) {
synchronized (this.changeRequests) {
// Indicate we want the interest ops set changed
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.CHANGEOPS, SelectionKey.OP_WRITE));
// And queue the data we want written
synchronized (this.pendingData) {
List queue = (List) this.pendingData.get(socket);
if (queue == null) {
queue = new ArrayList();
this.pendingData.put(socket, queue);
}
queue.add(ByteBuffer.wrap(data));
}
}
// Finally, wake up our selecting thread so it can make the required changes
this.selector.wakeup();
}
// close a connection server sided
public void disconnect(SocketChannel socket) {
synchronized (this.changeRequests) {
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.FORCECLOSE, 0));
}
this.selector.wakeup();
}
}

208
bioserver/Slot.java Normal file
View File

@@ -0,0 +1,208 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.nio.channels.SocketChannel;
/**
* class for a gameslot
* here are games organized
*/
public class Slot {
public final static byte STATUS_DISABLED = 0;
public final static byte STATUS_FREE = 1;
public final static byte STATUS_INCREATE = 2; // TODO: find this out
public final static byte STATUS_GAMESET = 3; // while creating ruleset
public final static byte STATUS_BUSY = 4; // FULL
// 0=training ground, 1=WT, ..., 6=elimination1
// TODO: possibly more ?
public final static byte SCENARIO_TRAINING = 0;
public final static byte SCENARIO_WILDTHINGS = 1;
public final static byte SCENARIO_UNDERBELLY = 2;
public final static byte SCENARIO_FLASHBACK = 3;
public final static byte SCENARIO_DESPERATETIMES = 4;
public final static byte SCENARIO_ENDOFTHEROAD = 5;
public final static byte SCENARIO_ELIMINATION1 = 6;
// 0 = not set 1 = dvd-rom 2 = hdd
// TODO: there are more! what means 0x11 ?
public final static byte LOAD_NOTSET = 0;
public final static byte LOAD_DVDROM = 1;
public final static byte LOAD_HARDSK = 2;
public final static byte PROTECTION_OFF = 0;
public final static byte PROTECTION_ON = 1;
public final static long WAITTIME_MILLSEC = 30*1000*1000;
public int area;
public int room;
public int slotnum;
public int gamenr;
public int betatest;
private byte[] name;
private byte status;
private byte[] password;
private byte protection; // using password ?
private byte scenario;
private byte slottype;
// rules for the game in slot
private RuleSet rules;
// timeout
private long livetime;
// room master's userid
private String host;
// create an empty slot
public Slot(int area, int room, int slotnum) {
this.area = area;
this.room = room;
this.slotnum = slotnum;
this.gamenr = 0;
this.betatest = 0;
this.name = "(free)".getBytes();
this.status = Slot.STATUS_FREE;
this.scenario = Slot.SCENARIO_TRAINING;
this.slottype = Slot.LOAD_NOTSET;
this.protection = Slot.PROTECTION_OFF;
this.rules = new RuleSet();
this.livetime = -1;
}
public void reset() {
this.name = "(free)".getBytes();
this.status = Slot.STATUS_FREE;
this.scenario = Slot.SCENARIO_TRAINING;
this.slottype = Slot.LOAD_NOTSET;
this.protection = Slot.PROTECTION_OFF;
this.gamenr = 0;
this.betatest = 0;
rules.reset();
}
public byte[] getName() {
return this.name;
}
public void setName(byte[] name) {
this.name = name;
}
public byte[] getPassword() {
return this.password;
}
public void setPassword(byte[] passwd) {
this.password = passwd;
if(passwd.length > 0) this.protection = Slot.PROTECTION_ON;
}
public byte getStatus() {
return this.status;
}
public void setStatus(byte status) {
this.status= status;
}
public byte getProtection() {
return this.protection;
}
public byte getSscenario() {
return this.scenario;
}
public void setSscenario(byte scenario) {
this.scenario = scenario;
}
public byte getSlotType() {
return this.slottype;
}
public void setSlotType(byte slottype) {
this.slottype = slottype;
}
public byte getRulesCount() {
return (byte) (this.rules.getRulesCount());
}
public byte getRulesAttCount(int rulenr) {
return (byte) (this.rules.getRulesAttCount(rulenr));
}
public String getRuleName(int rulenr) {
return rules.getRuleName(rulenr);
}
public byte getRuleValue(int rulenr) {
return rules.getRuleValue(rulenr);
}
public void setRuleValue(int rulenr, byte value) {
rules.setRuleValue(rulenr, value);
}
public byte getRuleAttribute(int rulenr) {
return rules.getRuleAttribute(rulenr);
}
public String getRuleAttributeDescription(int rulenr, int attnr) {
return rules.getRuleAttName(rulenr, attnr);
}
public byte getRuleAttributeAtt(int rulenr, int attnr) {
return rules.getRuleAttAtt(rulenr, attnr);
}
public void setLivetime() {
this.livetime = System.currentTimeMillis() + this.rules.getWaitTime()*60*1000;
}
// 0x0708 = 1800 seconds = 30 minutes
// on timeout always return 0, game will be started
public long getLivetime() {
long retval = (livetime - System.currentTimeMillis())/1000;
if (retval <0) retval = 0;
return retval;
}
public RuleSet getRuleSet() {
return this.rules;
}
public void setHost(String host) {
this.host = host;
}
public String getHost() {
return this.host;
}
}

134
bioserver/Slots.java Normal file
View File

@@ -0,0 +1,134 @@
/*
BioServer - Emulation of the long gone server for
Biohazard Outbreak File #1 (Playstation 2)
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package bioserver;
import java.util.LinkedList;
import java.util.List;
public class Slots {
private List slots;
private int numberOfAreas;
private int numberOfRooms;
private final int numberOfSlots = 20;
// create a list of empty slots
public Slots(int numberOfAreas, int numberOfRooms) {
slots = new LinkedList();
this.numberOfAreas = numberOfAreas;
this.numberOfRooms = numberOfRooms;
for(int area=1; area<=numberOfAreas; area ++) {
for(int room=1; room<=numberOfRooms; room++) {
for(int slot=0; slot<20; slot++) {
slots.add(new Slot(area, room, slot));
}
}
}
}
private int calcSlotnr(int area, int room, int slotnr) {
return ((slotnr-1) + ((room-1)*this.numberOfSlots) + ((area-1)*this.numberOfRooms*this.numberOfSlots));
}
public Slot getSlot(int area, int room, int slotnr) {
return (Slot) slots.get(calcSlotnr(area, room, slotnr));
}
public int getSlotCount() {
return this.numberOfSlots;
}
public byte getStatus(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getStatus();
}
public byte[] getName(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getName();
}
public byte getScenario(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getSscenario();
}
public byte getProtection(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getProtection();
}
public byte getSlotType(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getSlotType();
}
public byte getRulesCount(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRulesCount();
}
public byte getRulesAttCount(int area, int room, int slotnr, int rulenr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRulesAttCount(rulenr);
}
public String getRuleName(int area, int room, int slotnr, int rulenr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleName(rulenr);
}
public byte getRuleValue(int area, int room, int slotnr, int rulenr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleValue(rulenr);
}
public byte getRuleAttribute(int area, int room, int slotnr, int rulenr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleAttribute(rulenr);
}
public String getRuleAttributeDescription(int area, int room, int slotnr, int rulenr, int attnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleAttributeDescription(rulenr, attnr);
}
public byte getRuleAttributeAtt(int area, int room, int slotnr, int rulenr, int attnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleAttributeAtt(rulenr, attnr);
}
public byte getDifficulty(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleSet().getDifficulty();
}
public byte getFriendlyFire(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleSet().getFriendlyFire();
}
public byte getMaximumPlayers(int area, int room, int slotnr) {
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
return slot.getRuleSet().getNumberOfPlayers();
}
}

View File

@@ -0,0 +1,8 @@
# Configuration for the server
# IP address for gameserver
gs_ip=192.168.6.66
# credentials for the database
db_user=bioserver
db_password=xxxxxxxxxxxxxxxx