~starkingdoms/starkingdoms

48e9c4fd7b07acefdd3feee19e584f5b24936d0e — ghostlyzsh 1 year, 8 months ago 6f03a2a + 708a158
merge
M server/src/main.rs => server/src/main.rs +9 -10
@@ 1614,14 1614,8 @@ fn break_modules(
fn save_eligibility(
    rapier_context: Res<RapierContext>,
    planet_query: Query<(Entity, &PlanetType, &Children)>,
    attached_query: Query<
        &Attach,
        (Without<PlanetType>, Without<Player>),
    >,
    collider_query: Query<
        (&Collider, &Parent),
        (Without<Player>, Without<Attach>),
    >,
    attached_query: Query<&Attach, (Without<PlanetType>, Without<Player>)>,
    collider_query: Query<(&Collider, &Parent), (Without<Player>, Without<Attach>)>,
    mut player_query: Query<&mut Player>,
    mut packet_send: EventWriter<WsEvent>,
) {


@@ 1675,7 1669,10 @@ fn save_eligibility(
                };
                if player_query.contains(other) {
                    let mut player = player_query.get_mut(other).unwrap();
                    if player.save_eligibility && !(player_eligibilities.contains_key(&other) && *player_eligibilities.get(&other).unwrap()) {
                    if player.save_eligibility
                        && !(player_eligibilities.contains_key(&other)
                            && *player_eligibilities.get(&other).unwrap())
                    {
                        println!("herefalse");
                        player.save_eligibility = false;
                        player_eligibilities.insert(other, false);


@@ 1687,7 1684,9 @@ fn save_eligibility(
    for (other, eligible) in player_eligibilities.iter() {
        let mut player = player_query.get_mut(*other).unwrap();
        player.save_eligibility = *eligible;
        let packet = Packet::SaveEligibility { eligible: *eligible };
        let packet = Packet::SaveEligibility {
            eligible: *eligible,
        };

        packet_send.send(WsEvent::Send {
            to: player.addr,

M starkingdoms-client/src/config.ts => starkingdoms-client/src/config.ts +2 -3
@@ 37,7 37,7 @@ async function fetchWithTimeout(resource: RequestInfo | URL, options = {}) {
}

export async function loadConfig(): Promise<Config> {
  /*logger("loading configuration from " + CONFIG_URL);
  logger("loading configuration from " + CONFIG_URL);
  try {
    const response = await fetchWithTimeout(CONFIG_URL, {
      timeout: 1000,


@@ 47,8 47,7 @@ export async function loadConfig(): Promise<Config> {
    logger(`error loading configuration: ${e}, using fallback`);
    // @ts-ignore strong types are unhelpful here
    return CONFIG;
  }*/
  return CONFIG;
  }
}

export const DEFAULT_CONFIG = CONFIG;

M starkingdoms-client/src/globals.ts => starkingdoms-client/src/globals.ts +1 -0
@@ 58,6 58,7 @@ export const global: GlobalData = {
  right: false,
  rendering: null,
  saveEligible: false,
  leaving: false,
};

export function player(): Part | undefined {

M starkingdoms-client/src/pages/Play.svelte => starkingdoms-client/src/pages/Play.svelte +1 -1
@@ 167,7 167,7 @@
      <tbody>
        <tr>
          <td id="leave">
              <Button on:click={beam_out} bind:this={beam_out_button}>
            <Button on:click={beam_out} bind:this={beam_out_button}>
              Beam out
            </Button>
          </td>