[Development] Rice - A Drift City USA Emulator.

Page 4 of 8 FirstFirst 12345678 LastLast
Results 46 to 60 of 109
  1. #46
    Registered elmakong is offline
    MemberRank
    Dec 2012 Join Date
    7Posts

    Re: [Development] Rice - A Drift City USA Emulator.


    RaGEZONE Recommends

    RaGEZONE Recommends

    Quote Originally Posted by savetherobots View Post
    Latest GC DC.
    how to edit that client version tor run?at least for DCPS..

  2. #47
    Developer Eronisch is offline
    True MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    1,329Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Quote Originally Posted by GigaToni View Post
    So because savetherobots has not much time I'll try to help him with this :).

    My fork:
    https://github.com/exmex/RiceEmu

    Figured the Chat structure out

    Spoiler:






    Shop structure
    Spoiler:




    I was looking at your code and a few things came up to me.

    - Why are you using 4 if's if you can make it a switch? Would also save you the trouble to lowercase it.
    - I'm not sure what channel means, but if possible you could use an enum. Avoid using magic numbers/strings
    DeskoList.com
    DeskoList is a premium topsite for free. We provide a rich experience for users and administrators with many features to choose from.

  3. #48
    Moderator GigaToni is offline
    ModeratorRank
    Aug 2009 Join Date
    GER / FRLocation
    1,994Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Because it was only a test. Before you can properly code you'll need to get the packet structure. I don't have a packet logger so I need to play around with things.. There is no proper code in the picture because the packet structure / variable types are unknown to me.

  4. #49
    Fuck. SheenBR is offline
    ModeratorRank
    Feb 2008 Join Date
    Jaú, BrazilLocation
    2,391Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Anybody knows if this decryption method works with current client of drift city?

  5. #50
    Ultimate Member savetherobots is offline
    MemberRank
    Apr 2010 Join Date
    198Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Quote Originally Posted by SheenBR View Post
    Anybody knows if this decryption method works with current client of drift city?
    For that reason upon exchanging keys Rice tells the client to disable encryption.
    <Brandon> everyone has sp3 xp anyway

    Rice

  6. #51
    Fuck. SheenBR is offline
    ModeratorRank
    Feb 2008 Join Date
    Jaú, BrazilLocation
    2,391Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    I asked that because of packet sniffing. I noticed the emulator is not very much completed, and if I can't sniff the official client for packets I couldnt do anything

  7. #52
    Banned xTraacex is offline
    BannedRank
    Jan 2014 Join Date
    39Posts

    Re: [Development] Frodo - A Drift City USA Emulator

    To bad , this seems dead :)

  8. #53
    Fuck. SheenBR is offline
    ModeratorRank
    Feb 2008 Join Date
    Jaú, BrazilLocation
    2,391Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Yes, still no notice about this encryption method.. not much for us to collaborate without it I suppose

  9. #54
    Registered rojeh222 is offline
    MemberRank
    May 2011 Join Date
    15Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Even though it shows that the server is running I can't connect (Login)



    Servers stays offline , DB exists > db info correct > etc... any help?

  10. #55
    Gold subscription Snopboy is offline
    Gold SubscriberRank
    Sep 2011 Join Date
    Kerning PQLocation
    988Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Quote Originally Posted by rojeh222 View Post
    Even though it shows that the server is running I can't connect (Login)



    Servers stays offline , DB exists > db info correct > etc... any help?
    I'm no expert of DC servers but I do know a few things that might help you out.
    If you're trying to login on the same machine you're running the server, try to login with the IP of 127.0.0.1 or localhost.
    If you're trying to login from a different machine, use the correct IP and open the right ports (or set it to DMZ host) on the host machine.
    If both machines are connected to the same router, try login to the LAN IP of the machine within the network (e.g. 192.xxx.xxx.xxx/10.0.0.xx).
    PHP<3
    Looking for PHP developers for code reviews, PM me

  11. #56
    Registered rojeh222 is offline
    MemberRank
    May 2011 Join Date
    15Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Quote Originally Posted by SnopBoy View Post
    I'm no expert of DC servers but I do know a few things that might help you out.
    If you're trying to login on the same machine you're running the server, try to login with the IP of 127.0.0.1 or localhost.
    If you're trying to login from a different machine, use the correct IP and open the right ports (or set it to DMZ host) on the host machine.
    If both machines are connected to the same router, try login to the LAN IP of the machine within the network (e.g. 192.xxx.xxx.xxx/10.0.0.xx).

    The first thing I did was to connect with the same computer the server is hosted on so I don't make it complicated
    And the result is the one I did post about earlier

  12. #57
    Ultimate Member savetherobots is offline
    MemberRank
    Apr 2010 Join Date
    198Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    As of a week or so ago, RiceEmu on GitHub is only there to provide a base for the RZ community for Drift City emulator development. The open-source version is no longer being actively developed. I will be accepting any (reasonable) pull requests RZ users submit, but you're better off making a fork of the project.
    <Brandon> everyone has sp3 xp anyway

    Rice

  13. #58
    Member sciso is offline
    MemberRank
    Aug 2013 Join Date
    m_vecOriginLocation
    33Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    EDIT: Made a price table on the shop structure i know its a bunch of ifs and else ifs but its just a test code!


    Shop.cs (thx to GigaToni who made the original structure)
    using System;
    using Rice.Server.Structures;
    using System.Data.Common;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Rice.Server.Core;

    namespace Rice.Server.Packets.Game
    {
    public static class Shop
    {
    [RicePacket(405, RiceServer.ServerType.Game)]
    public static void BuyItem(RicePacket packet)
    {


    // 0 = Item ID
    // 1 = Dont have any Idea
    // 2 = Quantity

    int itemID = packet.Reader.ReadInt16();
    int unknown = packet.Reader.ReadInt16();
    int quantity = packet.Reader.ReadInt16();
    int price = 400;

    Log.WriteLine ("{0} {1} {2}", itemID, unknown, quantity);

    // 0 = Item ID
    // 1 = Dont have any idea
    // 2 = Qauntity

    //Price Table With Item ID
    if (itemID == 0)
    price = 250;
    else if (itemID == 5)
    price = 400;
    else if (itemID == 10)
    price = 1050;
    else if (itemID == 15)
    price = 2000;
    else if (itemID == 20)
    price = 3250;
    else if (itemID == 25)
    price = 250;
    else if (itemID == 30)
    price = 400;
    else if (itemID == 35)
    price = 1050;
    else if (itemID == 40)
    price = 2000;
    else if (itemID == 45)
    price = 3250;
    else if (itemID == 50)
    price = 250;
    else if (itemID == 55)
    price = 400;
    else if (itemID == 60)
    price = 1050;
    else if (itemID == 65)
    price = 2000;
    else if (itemID == 70)
    price = 3250;
    else if (itemID == 75)
    price = 250;
    else if (itemID == 80)
    price = 400;
    else if (itemID == 85)
    price = 1050;
    else if (itemID == 90)
    price = 2000;
    else if (itemID == 95)
    price = 3250;
    else if (itemID == 1445)
    price = 5000 * quantity;
    else if (itemID == 1488)
    price = 50 * quantity;
    else if (itemID == 1502)
    price = 200 * quantity;
    else if (itemID == 1503)
    price = 1000 * quantity;
    else if (itemID == 1504)
    price = 30000 * quantity;
    else if (itemID == 1516)
    price = 5000 * quantity;
    else if (itemID == 1554)
    price = 100 * quantity;
    else if (itemID == 1561)
    price = 1000 * quantity;
    else if (itemID == 1568)
    price = 500 * quantity;
    else if (itemID == 1569)
    price = 1000 * quantity;
    else if (itemID == 1570)
    price = 2000 * quantity;
    else if (itemID == 1665)
    price = 1000 * quantity;
    else if (itemID == 1666)
    price = 1000 * quantity;
    else if (itemID == 1667)
    price = 1000 * quantity;
    else if (itemID == 1818)
    price = 3000 * quantity;
    else if (itemID == 1874)
    price = 49000 * quantity;
    else if (itemID == 1875)
    price = 63000 * quantity;
    else if (itemID == 1876)
    price = 98000 * quantity;
    else if (itemID == 1877)
    price = 196000 * quantity;
    else if (itemID == 2546)
    price = 4000 * quantity;
    else if (itemID == 2547)
    price = 6000 * quantity;
    else if (itemID == 2548)
    price = 7000 * quantity;
    else if (itemID == 1979)
    price = 1200 * quantity;
    else if (itemID == 1980)
    price = 700 * quantity;
    else if (itemID == 1981)
    price = 2000 * quantity;
    else if (itemID == 1982)
    price = 100 * quantity;
    else if (itemID == 2032)
    price = 1000 * quantity;
    else if (itemID == 1989)
    price = 10000 * quantity;
    else if (itemID == 2013)
    price = 15000 * quantity;
    else if (itemID == 2014)
    price = 15000 * quantity;
    else if (itemID == 2015)
    price = 15000 * quantity;
    else if (itemID == 2034)
    price = 10000 * quantity;
    else if (itemID == 2068)
    price = 5000 * quantity;
    else if (itemID == 2069)
    price = 7000 * quantity;
    else if (itemID == 2070)
    price = 10000 * quantity;
    else if (itemID == 2700)
    price = 10000 * quantity;
    else if (itemID == 2708)
    price = 10000 * quantity;
    else if (itemID == 2709)
    price = 10000 * quantity;
    else if (itemID == 2003)
    price = 10000 * quantity;
    else if (itemID == 2004)
    price = 12000 * quantity;
    else if (itemID == 2005)
    price = 15000 * quantity;
    else if (itemID == 2031)
    price = 12000 * quantity;
    else if (itemID == 2036)
    price = 20000 * quantity;
    else if (itemID == 2025)
    price = 30000 * quantity;

    var ack = new RicePacket(406);
    ack.Writer.Write(itemID);
    ack.Writer.Write(quantity);
    ack.Writer.Write(price);

    packet.Sender.Send(ack);
    packet.Sender.Error ("This Item Should be in your Inventory but... :(");
    }

    }

    }
    and it worked



    Added the Inventory Level on database (HancoinInven)

    Character.cs (/Game/Character.cs)

    using Rice.Server.Structures;
    using System;
    using System.Collections.Generic;
    using System.Data.Common;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace Rice.Game
    {
    public class Character
    {
    public User User;
    public ulong UID;
    public ulong CID;

    public string Name;
    public long Mito;
    public int Avatar;
    public int Level;
    public int City;
    public int CurrentCarID;
    public int GarageLevel;
    public int InventoryLevel;
    public long TID;

    private Character()
    {
    }

    public CharInfo GetInfo()
    {
    return new CharInfo
    {
    Avatar = (ushort)Avatar,
    Name = Name,
    CID = CID,
    City = City,
    CurrentCarID = CurrentCarID,
    ExpInfo = new ExpInfo // load this
    {
    BaseExp = 0,
    CurExp = 0,
    NextExp = 0
    },
    HancoinGarage = GarageLevel,
    HancoinInven = InventoryLevel,
    Level = (ushort)Level,
    TeamId = TID,
    TeamName = "Staff", // load this
    MitoMoney = Mito
    };
    }

    public static Character Retrieve(string charname)
    {
    DbConnection dbconn = Database.GetConnection();

    DbCommand command = dbconn.CreateTextCommand("SELECT * FROM Characters WHERE Name = @char");

    command.AddParameter("@char", charname);

    Character character = null;

    using (DbDataReader reader = command.ExecuteReader())
    {
    if (reader.Read())
    {
    character = new Character();
    character.CID = Convert.ToUInt64(reader["CID"]);
    character.UID = Convert.ToUInt64(reader["UID"]);
    character.Name = reader["Name"] as string;
    character.Mito = Convert.ToInt64(reader["Mito"]);
    character.Avatar = Convert.ToInt32(reader["Avatar"]);
    character.Level = Convert.ToInt32(reader["Level"]);
    character.City = Convert.ToInt32(reader["City"]);
    character.CurrentCarID = Convert.ToInt32(reader["CurrentCarID"]);
    character.InventoryLevel = Convert.ToInt32(reader["InventoryLevel"]);
    character.GarageLevel = Convert.ToInt32(reader["GarageLevel"]);
    character.TID = Convert.ToInt64(reader["TID"]);
    }
    }

    return character;
    }

    public static List<Character> Retrieve(ulong uid)
    {
    DbConnection dbconn = Database.GetConnection();

    DbCommand command = dbconn.CreateTextCommand("SELECT * FROM Characters WHERE UID = @uid");

    command.AddParameter("@uid", uid);

    List<Character> chars = new List<Character>();

    using (DbDataReader reader = command.ExecuteReader())
    {
    while (reader.Read())
    {
    var character = new Character();
    character.CID = Convert.ToUInt64(reader["CID"]);
    character.UID = Convert.ToUInt64(reader["UID"]);
    character.Name = reader["Name"] as string;
    character.Mito = Convert.ToInt64(reader["Mito"]);
    character.Avatar = Convert.ToInt32(reader["Avatar"]);
    character.Level = Convert.ToInt32(reader["Level"]);
    character.City = Convert.ToInt32(reader["City"]);
    character.CurrentCarID = Convert.ToInt32(reader["CurrentCarID"]);
    character.InventoryLevel = Convert.ToInt32(reader["InventoryLevel"]);
    character.GarageLevel = Convert.ToInt32(reader["GarageLevel"]);
    character.TID = Convert.ToInt64(reader["TID"]);
    chars.Add(character);
    }
    }

    return chars;
    }
    }
    }
    and worked pretty well



    I'll keep this updated guys :)

    UPDATE: i've not posted new things because i dont know anything about drift city packing method so i cant get the packets structures to keep this development
    Last edited by sciso; 05-06-15 at 11:32 PM.

  14. #59
    Account Upgraded | Title Enabled! k0d0k is offline
    True MemberRank
    Dec 2014 Join Date
    ./index.phpLocation
    214Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    how to connect to run client?
    configuration IP how
    Lorem ipsum dolor sit amet.

  15. #60
    Member xspeed is offline
    MemberRank
    Apr 2005 Join Date
    LocalhostLocation
    43Posts

    Re: [Development] Rice - A Drift City USA Emulator.

    Quote Originally Posted by sciso View Post
    EDIT: Made a price table on the shop structure i know its a bunch of ifs and else ifs but its just a test code!


    Shop.cs (thx to GigaToni who made the original structure)


    and it worked



    Added the Inventory Level on database (HancoinInven)

    Character.cs (/Game/Character.cs)


    and worked pretty well



    I'll keep this updated guys :)

    UPDATE: i've not posted new things because i dont know anything about drift city packing method so i cant get the packets structures to keep this development

    what you use client version ? for join game. i have client 2012 but got problem gameguard, can you help me join game ?

    - - - Updated - - -

    what a problem i use 2012 client.



    - - - Updated - - -

    Delete Character Work

    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.Common;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Rice.Server.Core;


    namespace Rice.Server.Packets.Lobby
    {

    public static class User
    {

    [RicePacket(60, RiceServer.ServerType.Lobby)]
    public static void UserInfo(RicePacket packet)
    {
    Log.WriteLine("UserInfo request.");

    var settings = new RicePacket(30);
    settings.Writer.Write(Static.GameSettings);
    packet.Sender.Send(settings);

    packet.Sender.Player.Characters = Rice.Game.Character.Retrieve(packet.Sender.Player.User.UID);

    var ack = new RicePacket(61);

    ack.Writer.Write(0); // Permissions
    ack.Writer.Write(packet.Sender.Player.Characters.Count); // Character Count

    ack.Writer.WriteUnicodeStatic(packet.Sender.Player.User.Name, 18); // Username
    ack.Writer.Write((long)0);
    ack.Writer.Write((long)0);
    ack.Writer.Write((long)0);
    ack.Writer.Write(0);

    foreach (var character in packet.Sender.Player.Characters)
    {
    ack.Writer.WriteUnicodeStatic(character.Name, 21); // Name
    ack.Writer.Write(character.CID); // ID
    ack.Writer.Write(character.Avatar); // Avatar
    ack.Writer.Write(character.Level); // Level
    ack.Writer.Write(1);
    ack.Writer.Write(0x50);
    ack.Writer.Write(0);
    ack.Writer.Write(int.MaxValue / 2); // Creation Date
    ack.Writer.Write(character.TID); // Crew ID
    ack.Writer.Write(0L); // Crew Image
    ack.Writer.WriteUnicodeStatic("Staff", 12); // Crew Name
    ack.Writer.Write((short)0);
    ack.Writer.Write((short)-1);
    ack.Writer.Write((short)0);
    }

    packet.Sender.Send(ack);

    Log.WriteLine("Sent character list.");
    }

    [RicePacket(80, RiceServer.ServerType.Lobby)]
    public static void CheckCharacterName(RicePacket packet)
    {
    string characterName = packet.Reader.ReadUnicode();
    Log.WriteLine("VerifyCharName: {0}", characterName);

    // TODO: Verify

    var ack = new RicePacket(81);
    ack.Writer.WriteUnicodeStatic(characterName, 21);
    ack.Writer.Write(1); // Availability. 1 = Available, 0 = Unavailable.
    packet.Sender.Send(ack);
    }

    [RicePacket(82, RiceServer.ServerType.Lobby)]
    public static void CreateCharacter(RicePacket packet)
    {
    string characterName = packet.Reader.ReadUnicode();
    /*
    string UIDCreate = packet.Reader.ReadUnicode();

    DbConnection dbconn_c = Database.GetConnection();

    DbCommand crechar = dbconn_c.CreateCommand();

    crechar.CommandText = @"Insert into characters (UID, Name) values ('" + UIDCreate + "', '" + characterName + "')";
    */
    Log.WriteLine("Create Character Success Name: {0}", characterName);

    // TODO: Verify, Handle
    }

    [RicePacket(50, RiceServer.ServerType.Lobby)]
    public static void DeleteCharacter(RicePacket packet)
    {
    string characterName = packet.Reader.ReadUnicode();

    DbConnection dbconn_d = Database.GetConnection();

    DbCommand delchar = dbconn_d.CreateCommand();

    delchar.CommandText = @"Delete from characters Where Name =

    '" + characterName + " ' ";

    delchar.ExecuteNonQuery();

    Log.WriteLine("Delete Character Success Name: {0}", characterName);

    // TODO: Verify

    var ack = new RicePacket(84);
    ack.Writer.WriteUnicodeStatic(characterName, 21);
    packet.Sender.Send(ack);
    }
    }
    }




Page 4 of 8 FirstFirst 12345678 LastLast

Advertisement