Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hetuw committed May 30, 2019
2 parents c32c1fe + c3fa18d commit 2e3cfef
Show file tree
Hide file tree
Showing 14 changed files with 562 additions and 106 deletions.
49 changes: 49 additions & 0 deletions documentation/changeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,55 @@ This file only list changes to game code. Changes to content can be found here:
http://onehouronelife.com/updateLog.php



Version 235 2019-May-29

--Fixed one cause of rubber-banding player movement in client. No need to
navigate all the way back to start of a new path sent by server if we're
closer to a spot in the middle of the path.

--Fixed so that other players never slow down in their movement to match
server timing, but still speed up if necessary. (It's always okay for
another player to arrive at their destination early, client-side.)



Server Fixes

--Changes to function of /DIE. Can no longer use it to cycle through all
families and force yourself to be an unecessary Eve. Eve only spawns if
there are really no available motehrs for an incoming baby. /DIE adds this
family to your family skip list. If you eventually cycle through all
families, so that you've skipped them all, and none are left, your skip list
is cleared.

--When the server has 15 or more simultaneous players, 200 map database entries
are examined every periodic server step (4x per second), and any entries in
regions that have not been seen by players in 8 hours are set back to their
natural state. Depending on the size of the database, walking through all
entries can take quite a while (the current bigserver2 database has 25
million entries, so that would take 8 hours at the current rate). Thus, the
actual decay-back-to-nature time will be at least 8 hours, due to the time it
takes to walk through all database entries. Also, a group of tiles will
potentially clear in an uneven sequence, based on their order in the
database. Thus, partial ruins are possible.

--Don't spawn non-cursed Eve near donkey town.

--Always reset mother's birth cool down if baby does /DIE, whether ever held
or not.

--Mother's birth cool-down instantly resets when her most-recent baby dies of
any cause.

--Max birth cool-down for mother is 3 minutes instead of 5 (mean 1.2 minutes
instead of 2 minutes).

--Ancient stone walls are left standing during 8-hour-no-look map culling.




Version 234 2019-May-25

--Fixed long-standing bug when something decays in the hand of a moving player,
Expand Down
46 changes: 30 additions & 16 deletions gameSource/LivingLifePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15483,26 +15483,33 @@ void LivingLifePage::step() {

printf( "Manually forced\n" );

// find closest spot along path
// to our current pos
double minDist = DBL_MAX;

// prev step
int b =
(int)floor(
fractionPassed *
( existing->pathLength - 1 ) );
// next step
int n =
(int)ceil(
fractionPassed *
( existing->pathLength - 1 ) );
int b = -1;

if( n == b ) {
if( n < existing->pathLength - 1 ) {
n ++ ;
}
else {
b--;
for( int testB=0;
testB < existing->pathLength - 1;
testB ++ ) {

doublePair worldPos = gridToDouble(
existing->pathToDest[testB] );

double thisDist =
distance( worldPos,
existing->currentPos );
if( thisDist < minDist ) {
b = testB;
minDist = thisDist;
}
}


// next step
int n = b + 1;

existing->currentPathStep = b;

doublePair nWorld =
Expand Down Expand Up @@ -15552,7 +15559,14 @@ void LivingLifePage::step() {
double timeAdjust =
existing->moveTotalTime * fractionDiff;

existing->moveEtaTime += timeAdjust;
if( fractionDiff < 0 ) {
// only speed up...
// never slow down, because
// it's always okay if we show
// player arriving early

existing->moveEtaTime += timeAdjust;
}
}


Expand Down
2 changes: 1 addition & 1 deletion gameSource/game.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
int versionNumber = 234;
int versionNumber = 235;
int dataVersionNumber = 0;

int binVersionNumber = versionNumber;
Expand Down
1 change: 1 addition & 0 deletions scripts/forceOneServerShutdown.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cd ~/checkout/OneLife/server; echo 1 > settings/forceShutdownMode.ini; sleep 2; git checkout settings/forceShutdownMode.ini
112 changes: 112 additions & 0 deletions server/familySkipList.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#include "familySkipList.h"

#include "minorGems/util/SimpleVector.h"
#include "minorGems/util/stringUtils.h"
#include "minorGems/system/Time.h"



typedef struct FamilySkipListRecord {
char *babyEmail;

SimpleVector<int> *skippedLineageList;

double lastUpdateTime;
} FamilySkipListRecord;


static void freeRecordMembers( FamilySkipListRecord *inR ) {
delete [] inR->babyEmail;
delete inR->skippedLineageList;
}

SimpleVector<FamilySkipListRecord> skipListRecords;



void initFamilySkipList() {
}



void freeFamilySkipList() {
for( int i=0; i<skipListRecords.size(); i++ ) {
FamilySkipListRecord *r = skipListRecords.getElement( i );
freeRecordMembers( r );
}
skipListRecords.deleteAll();
}



// makes new one if one doesn't exist, if requested,
// or returns NULL if not found
static FamilySkipListRecord *findRecord( char *inBabyEmail,
char inMakeNew = false ) {
double curTime = Time::getCurrentTime();

for( int i=0; i<skipListRecords.size(); i++ ) {
FamilySkipListRecord *r = skipListRecords.getElement( i );

if( strcmp( r->babyEmail, inBabyEmail ) == 0 ) {
return r;
}
else if( curTime - r->lastUpdateTime > 7200 ) {
// record not touched for 2 hours
freeRecordMembers( r );
skipListRecords.deleteElement( i );
i--;
}
}

// no matching email found

if( ! inMakeNew ) {
return NULL;
}

FamilySkipListRecord newR =
{ stringDuplicate( inBabyEmail ),
new SimpleVector<int>(),
curTime };

skipListRecords.push_back( newR );

return skipListRecords.getElement( skipListRecords.size() - 1 );
}



void skipFamily( char *inBabyEmail, int inLineageEveID ) {
FamilySkipListRecord *r = findRecord( inBabyEmail, true );

r->skippedLineageList->push_back( inLineageEveID );
}



void clearSkipList( char *inBabyEmail ) {
FamilySkipListRecord *r = findRecord( inBabyEmail );

if( r != NULL ) {
r->skippedLineageList->deleteAll();
}
}



char isSkipped( char *inBabyEmail, int inLineageEveID ) {

FamilySkipListRecord *r = findRecord( inBabyEmail );

if( r == NULL ) {
return false;
}

if( r->skippedLineageList->getElementIndex( inLineageEveID ) != -1 ) {
return true;
}

return false;
}

15 changes: 15 additions & 0 deletions server/familySkipList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


void initFamilySkipList();


void freeFamilySkipList();


void skipFamily( char *inBabyEmail, int inLineageEveID );


void clearSkipList( char *inBabyEmail );


char isSkipped( char *inBabyEmail, int inLineageEveID );
1 change: 1 addition & 0 deletions server/makeFileList
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ curseLog.cpp \
spiral.cpp \
objectSurvey.cpp \
language.cpp \
familySkipList.cpp \



Expand Down
Loading

0 comments on commit 2e3cfef

Please sign in to comment.