Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Fixing Battle Group "Asdf Asdf source"

Experienced Elementalist
Joined
Jan 31, 2014
Messages
228
Reaction score
25
Hello guys, Today I decided to share my information and progress in Battle Group.

i notice that:

"I USE DIFFERENT AND PERSONAL SOURCE, MY SOURCE WORK DIFFERENTLY BY SOURCE OF ASDF ASDF. SO DO NOT EXPECT THAT WILL GIVE YOU THE COMPLETE SOLUTION ALL AND NOW THE WHY AM I DOING AS A HOBBY".

Now let's start the editing project!

First of all we need to edit the VehicleSeat.cs... why?? Simple, the client wants to know 4 information:

-Initial Ammo "First CT"
-Current Ammo "First CT"
-Initial Ammo "Second CT"
-Current Ammo "Second CT"

if you check in handle_room_data the subtype vehicle_join you see the "SendBlocke's" is 5... nah nah,the good "JoinVehicle" is 8"SendBlock's" but go slowly and to order.

The information of Current and Initial ammo at first join the server go to see in DataBase.... The value "For the most of the vehicles" it's the same "For good job we need to edit database and method splitting the information in roomvehicle.cs but i talk for this in second moment".

Now the current VehicleSeat.cs is this

using System;using System.Collections;
using System.Linq;
using System.Text;


using GameServer.Managers;
using GameServer.Networking.Packets;
using GameServer.Virtual_Objects.Room;
using GameServer.Virtual_Objects.User;


namespace GameServer
{


class VehicleSeat
{


public Vehicle _OwnerVehicle;
public Vehicle OwnerVehicle
{
get { return this._OwnerVehicle; }
}
public virtualUser _Owner = null;
public virtualUser Owner()
{
return this._Owner;
}
internal void TakeOwnership(Vehicle _OwnerVehicle)
{
if (this._OwnerVehicle == null)
this._OwnerVehicle = _OwnerVehicle;
}


public bool TakeSeat(virtualUser client)
{
if (this._Owner == null)
{
this._Owner = client;
return true;
}
return false;
}
public void LeaveSeat()
{
this._Owner = null;
}


public int _MainCT;
public int MainCT
{
get { return this._MainCT; }
set { this._MainCT = value; }
}
public int _SubCT;
public int SubCT
{
get { return this._SubCT; }
set { this._SubCT = value; }
}
public string _SeatCode;
public string SeatCode
{
get { return this._SeatCode; }
}


public VehicleSeat(int _MainCT, int _SubCT, string _SeatCode)
{
this._MainCT = _MainCT;
this._SubCT = _SubCT;
this._SeatCode = _SeatCode;
}


}
}

Now edit with this:

using System;using System.Collections;
using System.Linq;
using System.Text;


using GameServer.Managers;
using GameServer.Networking.Packets;
using GameServer.Virtual_Objects.Room;
using GameServer.Virtual_Objects.User;


namespace GameServer
{


class VehicleSeat
{


public Vehicle _OwnerVehicle;
public Vehicle OwnerVehicle
{
get { return this._OwnerVehicle; }
}
public virtualUser _Owner = null;
public virtualUser Owner()
{
return this._Owner;
}
internal void TakeOwnership(Vehicle _OwnerVehicle)
{
if (this._OwnerVehicle == null)
this._OwnerVehicle = _OwnerVehicle;
}


public bool TakeSeat(virtualUser client)
{
if (this._Owner == null)
{
this._Owner = client;
return true;
}
return false;
}
public void LeaveSeat()
{
this._Owner = null;
}


public int _MainCT;
public int MainCT
{
get { return this._MainCT; }
set { this._MainCT = value; }
}
public int _CMainCT;
public int CMainCT
{
get { return this._CMainCT; }
set { this._CMainCT = value; }
}
public int _SubCT;
public int SubCT
{
get { return this._SubCT; }
set { this._SubCT = value; }
}
public int _CSubCT;
public int CSubCT
{
get { return this._CSubCT; }
set { this._CSubCT = value; }
}
public string _SeatCode;
public string SeatCode
{
get { return this._SeatCode; }
}


public VehicleSeat(int _MainCT, int _SubCT, string _SeatCode)
{
this._MainCT = _MainCT;
this._CMainCT = _MainCT
this._SubCT = _SubCT;
this._CSubCT = _SubCT;
this._SeatCode = _SeatCode;
}


}
}

"I remember for all, this is momentary version of vehicleseat, after i will edit roomvehicle,DB and vehicleseat."

now let's go to handle_room_data.cs and go to subtype.JoinVehicle...
The current joinvehicle is:

case Subtype.JoinVehicle: {
int vehicleID = int.Parse(getBlock(7));
currentRoom.Vehicles[vehicleID].Join(User);
sendBlocks[8] = currentRoom.Vehicles[vehicleID].Health.ToString();
sendBlocks[9] = currentRoom.Vehicles[vehicleID].MaxHealth.ToString();
sendBlocks[10] = currentRoom.Vehicles[vehicleID].FindSeat(User).MainCT.ToString();
sendBlocks[11] = currentRoom.Vehicles[vehicleID].FindSeat(User).SubCT.ToString();
sendBlocks[13] = currentRoom.Vehicles[vehicleID].GetSeat(User).ToString();
User.currentVehicle = currentRoom.Vehicles[vehicleID];
break;
}

Now edit with this:

case Subtype.JoinVehicle: {
int vehicleID = int.Parse(getBlock(7));
currentRoom.Vehicles[vehicleID].Join(User);
sendBlocks[6] = vehicleID.ToString();
sendBlocks[7] = currentRoom.Vehicles[vehicleID].GetSeat(User).ToString();
sendBlocks[8] = currentRoom.Vehicles[vehicleID].Health.ToString();
sendBlocks[9] = currentRoom.Vehicles[vehicleID].MaxHealth.ToString();
sendBlocks[10] = currentRoom.Vehicles[vehicleID].FindSeat(User).MainCT.ToString();
sendBlocks[11] = currentRoom.Vehicles[vehicleID].FindSeat(User).CMainCT.ToString();
sendBlocks[12] = currentRoom.Vehicles[vehicleID].FindSeat(User).SubCT.ToString();
sendBlocks[13] = currentRoom.Vehicles[vehicleID].FindSeat(User).CSubCT.ToString();
User.currentVehicle = currentRoom.Vehicles[vehicleID];
break;
}

At the moment is all.
:thumbup1::thumbup1:
Stay tuned, at soon i fix changeseat and leavevehicle and fix the second the bug "1 player in vehicle, second player not enter"

Bye Bye:eek:tt1::eek:tt1:
 
Back
Top