Register for your free account! | Forgot your password?

You last visited: Today at 05:17

  • Please register to post and access all features, it's quick, easy and FREE!


COPS v7 Emulator (v5065 C++/Qt4)

Reply
 
Old   #1

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,055
COPS v7 Emulator (v5065 C++/Qt4)

I worked a bit on a C++ emulator for the game Era of Faith, but decided to just retire myself from everything related to TQ. Anyway, I wasn't really developing actively anyway.

I decided to release the C++ emulator (not enough good references in this language), but EoF is not really known, so a CO2 fork is more appropriate. I took some time to fork my project for the patch 5065 and implement few other features to be considered fine enough to be a base.

This emulator is released under a 4-clause BSD license. Meaning that you're free to do whatever you want with this source, but it must keep the original license somewhere for paternity. When using this source, you must specify that you used software developed by Jean-Philippe Boivin (CptSky is okay too). Leechers won't probably respect the license which only state to give credits, but eh, at least I tried

Check the LICENSE file for more information about third party modules.

Code:
                               COPS v7 Emulator
                               ----------------

                   Copyright (C) 2012 - 2014 Jean-Philippe Boivin
              https://bitbucket.org/jpboivin/cops-v7-emulator/overview

Overview
--------

COPS v7 Emulator is a fork of Faith Emulator, a C++ emulator of the MMORPG
Era of Faith. COPS v7 Emulator is a fork targeting the MMORPG Conquer Online,
at the patch 5065.

The emulator is developed in C++ with Qt4 / Qt5.
N.B. The QMySQL driver must be build to use the QSQL module properly.

Features
--------

COPS v7 Emulator is currently released as a base source. Most functionalities
are not implemented or completed. However, some features have special and
interesting implementation.

+ Support any POSIX and/or WinAPI operating system with Qt
+ Support any architecture (little endian & big endian | 32 bit & 64 bit)
+ Separate worker for logging (see zfserv.log)
+ Self destructed environment (useful for singletons)
+ MySQL5 database based on the official one

+ Security module
  - Custom implementations for:
    * TQ's custom cipher
    * Blowfish (CFB64)
    * RC5 (32/12/16)
    * Diffie-Hellman exchange

+ Map module
  - Parallel loading of Data Map (DMap) files
    * MapManager will detect the number of physical cores and spawn an appropriate
      amount of worker to load DMaps in parallel.
      e.g. On two PowerPC 970MP (dual core) @ 2.5 GHz, 4 workers will be spawn and
           it will takes less than 30s to load all DMap of a 5065 client.
  - Compressed data when unused
    * Each GameMap will detect when no player will be on the map, and than pack
      the data using the LZ4 algorithm and unpack the data when required.
      e.g. With a PowerPC (64 bit), at idle, the emulator will require less than
           10 MB of RAM to keep all DMap of a 5065 client in memory.
  - Shared data among all GameMaps

+ Script module
  - Shared Lua VM for executing scripts
  - Exposed accessors for the player informations
  - Exposed specialized functions (e.g. text(), link())

+ Generator module
  - Based on TQ's one, using the official spawns will result in the same in-game spawns

+ Character creation
+ Character loading / saving
+ Direction / Emotion / Pk Mode
+ Walking / Jumping
+ Portals
+ Points allocation
+ Talking to NPCs [Incomplete]
+ Screen system [Incomplete]

+ Item features
  - Buying items from NPCs
  - Selling items to NPCs
  - Repairing items
  - Using / eating items
  - Equiping items
  - Real item ID generation for monsters [Incomplete]

Documentation about the emulator can be generated with dOxygen.
To generate the documentation, please in the root folder of the source,
and call dOxygen with Doxyfile.

Supported systems
-----------------

The emulator has been tested on the following platforms:
- Windows XP Professional (SP2)
  + x86_64 [Will compile, untested otherwise]
- Mac OS X Leopard (10.5.8)
  + ppc, ppc64
- Mac OS X Mavericks (10.9.2)
  + (x86), x86_x64
- Debian Lenny (5.0)
  + ARM (armel)

The emulator has been tested with Qt 4.6.3, 4.8.4 & 5.2.1.

However, the emulator should work without any modification on any
POSIX-compliant system (Mac OS X, *NIX, GNU/Linux, etc) and on any
WinAPI system.

N.B. This emulator uses the Windows API and/or the POSIX API and/or the Qt API.
Changelists:

Version 0.1 bug-fixes for Mac OS X.
Attached Files
File Type: zip COPS v7 Emulator - v0.1.zip (4.30 MB, 646 views)
File Type: zip COPS v7 Emulator - v0.2.zip (4.40 MB, 455 views)
File Type: zip COPS v7 Emulator - v0.2.1.zip (4.55 MB, 4601 views)



CptSky is offline  
Thanks
37 Users
Old 02/06/2014, 23:46   #2
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
*High fives*


Spirited is offline  
Thanks
2 Users
Old 02/07/2014, 00:11   #3
 
elite*gold: 0
Join Date: Oct 2007
Posts: 1,504
Received Thanks: 573
Zero experience in C++ here but gave you a thank for the great effort.
turk55 is offline  
Thanks
1 User
Old 02/07/2014, 00:14   #4

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,055
Quote:
Originally Posted by turk55 View Post
Zero experience in C++ here but gave you a thank for the great effort.
It's never too late to learn a new language


CptSky is offline  
Old 02/07/2014, 00:33   #5
 
elite*gold: 0
Join Date: Oct 2007
Posts: 1,504
Received Thanks: 573
Quote:
Originally Posted by CptSky View Post
It's never too late to learn a new language
Yeap, but requires time and that is something I barelly have at the moment. :P
turk55 is offline  
Old 02/08/2014, 03:54   #6
 
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 171
Great release jp
Arco. is offline  
Old 02/20/2014, 04:10   #7

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,055
Seems to be an issue with VS 2012. Anyone can confirm ?
CptSky is offline  
Old 02/20/2014, 21:22   #8
 
elite*gold: 0
Join Date: Sep 2013
Posts: 197
Received Thanks: 140
This is definitely some of the most beautiful code I've seen here on epvp. Good job.
SteveRambo is offline  
Old 03/09/2014, 17:15   #9

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,055
The atomic increment won't work on older versions of OS X (probably due to the deprecated version of GCC), I recommend editing the macro to :

Code:
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif // atomics


#if defined(__APPLE__)
#   if defined(TARGET_INSTR_X86_64) || defined(TARGET_INSTR_PPC64)
#       define atomic_inc(ptr) OSAtomicIncrement64Barrier(((volatile int64_t*)ptr))
#   else
#       define atomic_inc(ptr) OSAtomicIncrement32Barrier(((volatile int32_t*)ptr))
#   endif
#elif defined (_WIN32)
#   define atomic_inc(ptr) InterlockedIncrement((ptr))
#elif defined(__GNUC__)
#   define atomic_inc(ptr) (__sync_fetch_and_add((ptr), 1) + 1)
#else
#   error "Need some more porting work for atomic_inc."
#endif
CptSky is offline  
Old 04/17/2014, 06:32   #10
 
elite*gold: 0
Join Date: Jun 2007
Posts: 96
Received Thanks: 12
can't compile on QT version 5.2.1
screenshot >
(QT newbie)
atef201080 is offline  
Old 04/17/2014, 09:13   #11
 
elite*gold: 12
Join Date: Jul 2011
Posts: 7,044
Received Thanks: 3,383
Quote:
Originally Posted by atef201080 View Post
can't compile on QT version 5.2.1
screenshot >
(QT newbie)
Which is why you compile it with the correct version of QT.
Spirited is offline  
Old 04/17/2014, 15:37   #12
 
elite*gold: 0
Join Date: Jun 2007
Posts: 96
Received Thanks: 12
Quote:
Originally Posted by Spirited View Post
Which is why you compile it with the correct version of QT.
i think latest version is better and I'll find better features and more stability I've googled the error and found its linker issue.
-----------
after downloading QT 4 and searching for Mingw 4.4 for hours and installing it
i get the same errors when compiling

----------
adding
Code:
LIBS += -lwinmm
at .pro file fixed it with QT latest version...
atef201080 is offline  
Old 04/17/2014, 18:41   #13

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,055
Yes, if using MinGW, VS extensions are not supported, so winmm is not linked.

For the error of sync_fetch_add, you should change the macro in common.h to :

Code:
#if defined(__APPLE__)
#   if defined(TARGET_INSTR_X86_64) || defined(TARGET_INSTR_PPC64)
#       define atomic_inc(ptr) OSAtomicIncrement64Barrier(((volatile int64_t*)ptr))
#   else
#       define atomic_inc(ptr) OSAtomicIncrement32Barrier(((volatile int32_t*)ptr))
#   endif
#elif defined (_WIN32)
#   define atomic_inc(ptr) InterlockedIncrement((ptr))
#elif defined(__GNUC__)
#   define atomic_inc(ptr) (__sync_fetch_and_add((ptr), 1) + 1)
#else
#   error "Need some more porting work for atomic_inc."
#endif
CptSky is offline  
Thanks
1 User
Old 04/18/2014, 04:00   #14
 
elite*gold: 0
Join Date: Jun 2007
Posts: 96
Received Thanks: 12
Another error...
Quote:
D/[..\COPSv7\src\Database\database.cpp:loadAllMaps(): 497] Executing SQL: SELECT `id`, `doc_id`, `type`, `weather`, `portal_x`, `portal_y`, `reborn_map`, `reborn_portal`, `light` FROM `map`
E/[..\COPSv7\src\Database\database.cpp:loadAllMaps(): 532] Failed to execute the following cmd : "SELECT `id`, `doc_id`, `type`, `weather`, `portal_x`, `portal_y`, `reborn_map`, `reborn_portal`, `light` FROM `map`"
Error: Using unsupported buffer type: 3 (parameter: 3) QMYSQL3: Unable to bind outvalues
atef201080 is offline  
Old 04/18/2014, 17:41   #15

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,055
Quote:
Originally Posted by atef201080 View Post
Another error...
You're using a MySQL 3 driver... You must build the MySQL 5 driver.


CptSky is offline  
Thanks
1 User
Reply

Tags
5065, c++, cops v7, cptsky, qt



« Release Dawn of the knights -Source (Redux Based) | TinyMap Scene Coordinates Fix »

Similar Threads
COPS v6 : Source & Tools [Custom Emulator]
01/09/2016 - CO2 PServer Guides & Releases - 163 Replies
So, as I'm no longer active in CO2 private server development, I'll release my lastest emulator. It is a custom source which include almost ALL features of CO2, plus custom ones. The missing or incomplete features were guild allies/enemies, Offline TG. ALL the skills and mostly ALL the items are coded and supported. Most NPCs too, but in french... So, there is a lot of TQ quests. The source is coded in C# and will work with 5017 clients. As I used an edited client, the database must be...
COPS v3 - Reborn Edition : Source & Tools [LOTF Emulator]
10/22/2012 - CO2 PServer Guides & Releases - 29 Replies
I was cleaning my hard drive and I found an old source. The source is based on LOTF. I used it during COPS v3 (August 2008 - June 2009). After, I worked on my custom source, but I was too lazy, so I reworked a bit on this one for a short private server: COPS v3 - Reborn Edition. The base is bad. After all, it's LOTF... The parts I coded/recoded during 2008/2009 are really bad, maybe worst than the original :rolleyes: I was learning. And the parts I recoded during the few months I worked on...
COPS v3 - Source & Tools [LOTF Emulator]
09/25/2012 - CO2 PServer Guides & Releases - 4 Replies
I reformatted a USB Key and found an old source dating of January 2009. The source is based on LOTF. I used it during COPS v3 (August 2008 - June 2009). It is the base of my previous release of the COPS v3 - Reborn Edition emulator. So, it's really not good... Anything to say, except that nobody should use it? Anyway, some people who have played COPS might be interested to see the source, or some special feature. The test emulator is from January 17th, 2009. So it doesn't contains the final...
[Help]How i can make [welcome ms](v5065)
06/14/2009 - CO2 PServer - Discussions / Questions - 5 Replies
Hello everone, -Can anyone tell me how i can make a welcome msg which tabel in database? -i'll be in wait guys! Cya



All times are GMT +1. The time now is 05:17.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.