Skip to content

Commit

Permalink
Merge branch 'master' of github.com:evemuproject/evemu_crucible
Browse files Browse the repository at this point in the history
  • Loading branch information
stschake committed Apr 2, 2012
2 parents 675bc98 + e857d5c commit 7e9490c
Show file tree
Hide file tree
Showing 26 changed files with 3,166 additions and 103 deletions.
1 change: 1 addition & 0 deletions include/eve-server/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class Client
bool SelectCharacter( uint32 char_id );
void JoinCorporationUpdate(uint32 corp_id);
void SavePosition();
void SaveAllToDatabase();
void UpdateSkillTraining();

double GetPropulsionStrength() const;
Expand Down
2 changes: 2 additions & 0 deletions include/eve-server/admin/GMCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ COMMAND( unban, ROLE_ADMIN,
"(charName) - removes ban on player's account")
COMMAND( kenny, ROLE_ADMIN,
"(ON,OFF,0,1) - enable/disable the Kenny Translator for your chatting entertainment!")
COMMAND( kill, ROLE_ADMIN,
"(entityID) - insta-pops a destroyable ship, drone, structure, if applicable")
/*COMMAND( entity, ROLE_ADMIN,
"(entityID) - unknown" )
COMMAND( chatban, ROLE_ADMIN,
Expand Down
1 change: 1 addition & 0 deletions include/eve-server/corporation/CorporationDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CorporationDB

PyRep *GetMyApplications(uint32 charID);
PyRep *GetApplications(uint32 corpID);
PyRep *GetMyShares(uint32 charID);
PyObject *GetEmploymentRecord(uint32 charID);
PyObject *GetMedalsReceived(uint32 charID);

Expand Down
25 changes: 25 additions & 0 deletions include/eve-server/inventory/AttributeEnum.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
------------------------------------------------------------------------------------
LICENSE:
------------------------------------------------------------------------------------
This file is part of EVEmu: EVE Online Server Emulator
Copyright 2006 - 2011 The EVEmu Team
For the latest information visit http://evemu.org
------------------------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt.
------------------------------------------------------------------------------------
Author: Captnoord
*/

#ifndef AttributeEnum_h__
#define AttributeEnum_h__

Expand Down
2,795 changes: 2,795 additions & 0 deletions include/eve-server/inventory/EffectsEnum.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions include/eve-server/inventory/InventoryItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ class InventoryItem
void DisableSaveTimer() { return m_saveTimer.Disable(); };
bool CheckSaveTimer(bool iReset = true) { return m_saveTimer.Check( iReset ); };

void SaveItem(); //save the item to the DB.

/*
* Attribute access:
*/
Expand Down Expand Up @@ -283,8 +285,6 @@ class InventoryItem
ItemData &data
);

void SaveItem(); //save the item to the DB.

void SendItemChange(uint32 toID, std::map<int32, PyRep *> &changes) const;
void SetOnline(bool newval);

Expand Down
5 changes: 4 additions & 1 deletion include/eve-server/ship/DestinyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DestinyManager {

//Configuration:
void SetShipCapabilities(InventoryItemRef ship);
void SetPosition(const GPoint &pt, bool update=true);
void SetPosition(const GPoint &pt, bool update=true, bool isWarping=false, bool isPostWarp=false);

//Global Actions:
void Stop(bool update=true);
Expand All @@ -74,6 +74,7 @@ class DestinyManager {
//Local Movement:
void Follow(SystemEntity *who, double distance, bool update=true);
void Orbit(SystemEntity *who, double distance, bool update=true);
void OrbitingCruise(SystemEntity *who, double distance, bool update=true);
void SetSpeedFraction(double fraction, bool update=true);
void AlignTo(const GPoint &direction, bool update=true);
void GotoDirection(const GPoint &direction, bool update=true);
Expand All @@ -96,6 +97,8 @@ class DestinyManager {
void SendAnchorLift(const InventoryItemRef itemRef) const;
void SendCloakShip(const ShipRef shipRef, const bool IsWarpSafe) const;
void SendUncloakShip(const ShipRef shipRef) const;
void SendSpecialEffect(const ShipRef shipRef, std::string effectString, uint32 moduleID, uint32 moduleTypeID,
uint32 targetID, uint32 chargeID, bool isOffensive, bool isActive, double duration) const;

protected:
void ProcessTic();
Expand Down
9 changes: 7 additions & 2 deletions include/eve-server/system/BubbleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#ifndef __BUBBLEMANAGER_H_INCL__
#define __BUBBLEMANAGER_H_INCL__

#define BUBBLE_RADIUS_METERS 500000.0 // EVE retail uses 250km and allows grid manipulation, for simplicity we dont and have our grid much larger
#define BUBBLE_HYSTERESIS_METERS 5000.0 // How far out of the existing bubble a ship needs to fly before being placed into a new or different bubble

class SystemEntity;
class SystemBubble;
class GPoint;
Expand All @@ -45,9 +48,11 @@ class BubbleManager {
void Process();

//call whenever an entity may have left its bubble.
void UpdateBubble(SystemEntity *ent, bool notify=true);
void UpdateBubble(SystemEntity *ent, bool notify=true, bool isWarping=false, bool isPostWarp=false);
//call when an entity is added to the system.
void Add(SystemEntity *ent, bool notify);
void Add(SystemEntity *ent, bool notify, bool isPostWarp=false);
//call to calculate new bubble's center from entity's velocity:
void NewBubbleCenter(GVector shipVelocity, GPoint & newBubbleCenter);
//call when an entity is removed from the system.
void Remove(SystemEntity *ent, bool notify);
void clear();
Expand Down
1 change: 1 addition & 0 deletions include/eve-server/system/SystemBubble.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class SystemBubble {
void _BubblecastRemoveBall(SystemEntity *about_who);

const double m_radius2; //radius squared.
const double m_position_check_radius_sqrd; // (radius + BUBBLE_HYSTERESIS_METERS) squared
static uint32 m_bubbleIncrementer;
uint32 m_bubbleID;
std::map<uint32, SystemEntity *> m_entities; //we do not own these.
Expand Down
3 changes: 2 additions & 1 deletion include/eve-server/system/SystemManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#include "system/BubbleManager.h"
#include "system/SystemDB.h"

#define ONE_AU_IN_METERS 1.495978707e11 // 1 astronomical unit in meters
//#define ONE_AU_IN_METERS 1.495978707e11 // 1 astronomical unit in meters
#define ONE_AU_IN_METERS 149598000000.0 // 1 astronomical unit in meters, per EVElopedia: http://wiki.eveonline.com/en/wiki/Astronomical_Unit
#define BASE_WARP_SPEED 3.0 // base default max warp speed of 3.0 AU/s

class PyRep;
Expand Down
10 changes: 0 additions & 10 deletions sql/evemu_dynamic-dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -793,16 +793,6 @@ CREATE TABLE `chrSkillQueue` (
`level` INT(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;

DROP TABLE IF EXISTS `dgmEffectsInfo`;
CREATE TABLE `dgmEffectsInfo` (
`effectID` int(11) NOT NULL,
`targetAttributeID` int(11) NOT NULL,
`sourceAttributeID` int(11) NOT NULL,
`calculationTypeID` int(11) NOT NULL,
`reverseCalculationTypeID` int(11) NOT NULL,
PRIMARY KEY (`effectID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Mail subsystem
DROP TABLE IF EXISTS `mailLabel`;
CREATE TABLE `mailLabel` (
Expand Down
8 changes: 5 additions & 3 deletions src/eve-common/packets/Destiny.xmlp
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ DST_WARPEXIT = 11
<real name="dest_z" />
<!-- 4 -->
<int name="distance" />
<!-- 5 -->
<int name="u5" />
<!-- 5: warp speed in AU/s times 10 -->
<int name="warpSpeed" />
</tupleInline>
</tupleInline>
</elementDef>
Expand Down Expand Up @@ -733,7 +733,9 @@ DST_WARPEXIT = 11
<tupleInline>
<int name="entityID" />
<!-- seen 1206 -->
<int name="unknown" />
<int name="unknownInt" />
<!-- always seems to be false -->
<bool name="unknownBool" />
</tupleInline>
</tupleInline>
</elementDef>
Expand Down
2 changes: 1 addition & 1 deletion src/eve-common/packets/DogmaIM.xmlp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</listInline>
<long name="startTime" />
<long name="duration" /> <!-- seen an 0x07! I think it means infinite. -->
<int name="repeat" />
<raw name="repeat" />
<raw name="randomSeed" />
<raw name="error" />
<!-- <raw name="stall" /> -->
Expand Down
11 changes: 9 additions & 2 deletions src/eve-server/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ Client::~Client() {

// Save character info including attributes, save current ship's attributes, current ship's fitted mModulesMgr,
// and save all skill attributes to the Database:
//mModulesMgr.SaveModules(); // Save fitted Modules attributes to DB
GetShip()->SaveAttributes(); // Save Ship's attributes to DB
GetShip()->SaveShip(); // Save Ship's and Modules' attributes and info to DB
GetChar()->SaveCharacter(); // Save Character info to DB
GetChar()->SaveSkillQueue(); // Save Skill Queue to DB

Expand Down Expand Up @@ -1273,6 +1272,14 @@ void Client::SavePosition() {
GetShip()->Relocate( m_destiny->GetPosition() );
}

void Client::SaveAllToDatabase()
{
SavePosition();
GetChar()->SaveSkillQueue();
GetShip()->SaveShip();
GetChar()->SaveCharacter();
}

bool Client::LaunchDrone(InventoryItemRef drone) {
#if 0
drop 166328265
Expand Down
2 changes: 1 addition & 1 deletion src/eve-server/ServiceDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool ServiceDB::GetStationInfo(uint32 stationID, uint32 *systemID, uint32 *const
row.GetDouble(11)
);
// as it's direction, it should be normalized
dockOrientation->normalize();
//dockOrientation->normalize();
}

return true;
Expand Down
27 changes: 27 additions & 0 deletions src/eve-server/admin/GMCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,3 +1163,30 @@ PyResult Command_kenny( Client* who, CommandDB* db, PyServiceMgr* services, cons
return NULL;
}

PyResult Command_kill( Client* who, CommandDB* db, PyServiceMgr* services, const Seperator& args )
{
if( args.argCount() == 2 )
{
if( !args.isNumber( 1 ) )
{
throw PyException( MakeCustomError( "Argument 1 should be a character ID" ) );
}
uint32 entity = atoi( args.arg( 1 ).c_str() );

InventoryItemRef itemRef = services->item_factory.GetShip(entity);
if( itemRef == NULL )
throw PyException( MakeCustomError("/kill NOT supported on non-ship types at this time") );

// WARNING: This cast of SystemEntity * to DynamicSystemEntity * will CRASH if the get() does not return
// an object that IS a DynamicSystemEntity!!!
DynamicSystemEntity * shipEntity = (DynamicSystemEntity *)(who->System()->get(entity));
shipEntity->Destiny()->SendTerminalExplosion();
shipEntity->Bubble()->Remove(shipEntity, true);
//itemRef->Delete();
}
else
throw PyException( MakeCustomError("Correct Usage: /kill <entityID>") );

return NULL;
}

3 changes: 3 additions & 0 deletions src/eve-server/corporation/CorpRegistryService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ bool CorpRegistryBound::JoinCorporation(Client *who, uint32 newCorpID, const Cor
PyResult CorpRegistryBound::Handle_GetMember(PyCallArgs &call) {
// uint32 item = 0;
//item += 1;
sLog.Debug( "CorpRegistryBound", "Called GetMember stub." );
return NULL;
}

Expand Down Expand Up @@ -384,6 +385,8 @@ PyClass
dict["N=707075:302"]=0x1CC2383E961BFA8
*/
PyResult CorpRegistryBound::Handle_GetMembers(PyCallArgs &call) {

sLog.Debug( "CorpRegistryBound", "Called GetMembers stub." );
return NULL;
}

Expand Down
15 changes: 14 additions & 1 deletion src/eve-server/corporation/CorporationDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,4 +1343,17 @@ PyDict* CorporationDB::GetBookmarks(uint32 corporationID)
}
return DBResultToPackedRowDict(res, "bookmarkID");
//return DBResultToCRowset(res);
}
}

PyRep *CorporationDB::GetMyShares(uint32 charID) {
DBQueryResult res;
if (!sDatabase.RunQuery(res,
" SELECT corporationID, shares "
" FROM crpcharshares "
" WHERE characterID = %u ", charID))
{
codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
return NULL;
}
return DBResultToRowset(res);
}
17 changes: 0 additions & 17 deletions src/eve-server/corporation/CorporationService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,3 @@ PyResult CorporationService::Handle_GetRecruitmentAdsByCriteria( PyCallArgs& cal

return rs.Encode();
}

















27 changes: 24 additions & 3 deletions src/eve-server/inventory/InventoryBound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ PyResult InventoryBound::Handle_Add(PyCallArgs &call) {
sLog.Debug( "InventoryBound::Handle_Add()", "Cannot find key 'qty' from call.byname dictionary." );
return NULL;
}
uint32 quantity = call.byname.find("qty")->second->AsInt()->value();

uint32 quantity = 0;
if( call.byname.find("qty")->second->IsNone() )
quantity = 1;
else
quantity = call.byname.find("qty")->second->AsInt()->value();

std::vector<int32> items;
items.push_back(args.itemID);
Expand Down Expand Up @@ -389,7 +394,15 @@ PyRep *InventoryBound::_ExecAdd(Client *c, const std::vector<int32> &items, uint
else
{
//Unlike the other validate item requests, fitting an item requires a skill check, which means passing the character
if( (flag >= flagLowSlot0 && flag <= flagHiSlot7) || (flag >= flagRigSlot0 && flag <= flagRigSlot7) )
// (This also allows for flagAutoFit when someone drags a module or a stack of modules onto the middle of the fitting
// window and NOT onto a specific slot. 'flagAutoFit' means "put this module into which ever slot makes sense")
if( (flag == flagAutoFit) )
{
sLog.Error( "InventoryBound::_ExecAdd()", "ERROR: handling adding modules where flag = flagAutoFit not yet supported!!!" );
// uint32 newFlag = c->GetShip()->FindAvailableModuleSlot( newItem );
// c->GetShip()->AddItem( newFlag, newItem );
}
else if( (flag >= flagLowSlot0 && flag <= flagHiSlot7) || (flag >= flagRigSlot0 && flag <= flagRigSlot7) )
{
c->GetShip()->AddItem( flag, newItem );
}
Expand Down Expand Up @@ -431,7 +444,15 @@ PyRep *InventoryBound::_ExecAdd(Client *c, const std::vector<int32> &items, uint
else
{
//Unlike the other validate item requests, fitting an item requires a skill check
if( (flag >= flagLowSlot0 && flag <= flagHiSlot7) || (flag >= flagRigSlot0 && flag <= flagRigSlot7) )
// (This also allows for flagAutoFit when someone drags a module or a stack of modules onto the middle of the fitting
// window and NOT onto a specific slot. 'flagAutoFit' means "put this module into which ever slot makes sense")
if( (flag == flagAutoFit) )
{
sLog.Error( "InventoryBound::_ExecAdd()", "ERROR: handling adding modules where flag = flagAutoFit not yet supported!!!" );
// uint32 newFlag = c->GetShip()->FindAvailableModuleSlot( sourceItem );
// c->GetShip()->AddItem( newFlag, sourceItem );
}
else if( (flag >= flagLowSlot0 && flag <= flagHiSlot7) || (flag >= flagRigSlot0 && flag <= flagRigSlot7) )
{
c->GetShip()->AddItem( flag, sourceItem );
}
Expand Down
7 changes: 5 additions & 2 deletions src/eve-server/inventory/InventoryItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,11 @@ void InventoryItem::SetOnline(bool newval) {
ogf.env_target = m_locationID;
ogf.env_effectID = ogf.effectID;
ogf.startTime = ogf.when;
ogf.duration = INT_MAX; //I think this should be infinity (0x07 may be infinity?)
ogf.repeat = 0;
ogf.duration = -1; //INT_MAX; //I think this should be infinity (0x07 may be infinity?)
if(newval)
ogf.repeat = new PyInt(0);
else
ogf.repeat = new PyBool(false);
ogf.randomSeed = new PyNone();
ogf.error = new PyNone();

Expand Down
Loading

0 comments on commit 7e9490c

Please sign in to comment.